Cairo renderer adds garbage pixels to transparency
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
New
|
Undecided
|
Unassigned |
Bug Description
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06) on Windows. I am assuming that this is a Cairo issue, as I tested against 0.48, and saw that this issue did not occur there.
When exporting images with a transparent background, Inkscape will put save garbage color data into transparent pixels around the edges of your artwork (Eg: In a solid purple triangle, certain transparent pixels around the edge of the artwork will be colored yellow or black, with 0% alpha). This is not an issue if you are using the images for display only, but if you are using the images in any situation where colors may be interpolated, this can lead to very poor looking graphics, as the interpolation will use the garbage data in these transparent pixels to color neighboring pixels.
The easiest minimal reproduction is to simply create a triangle, click on it, and export your selection as a PNG. Open the newly created PNG in Photoshop/GIMP, convert the alpha channel to an image mask, and then delete the mask, so that all pixels are now fully opaque, with their original color information. Zoom in on the edges of your object and pixels will not all be the same color, despite the fact that there was only one color being used in the drawing.
I've attached an image to demonstrate the issue - I've done this process on a flat-filled purple path, with no stroke. You can clearly see off-colored pixels along the edge of the image (circled in red).
This issue currently makes Inkscape 0.92.2 unusable in the creation of game art, without manual post-processing of the rendered images, and is a major workflow impediment. I have reverted back to using 0.48 for now, but I would prefer to stay on the latest version for the improvements made there.
Likely related (if not a duplicate of) bug #170356.
The current development version (0.92+devel) allows exporting to PNG without anti-aliasing (which might or might not be acceptable for your application). You could check if this solves the issue you're describing.