Mobile app version of vmapp.org
Login or Join
Pierce403

: GIMP: Background removal gives gray fringe, when exported as PDF I cut a region out of this Wikimedia Commons picture: I simply used the free select tool to cut out the part (ctrl+x) and

@Pierce403

Posted in: #Alpha #BackgroundRemoval #Gimp

I cut a region out of this Wikimedia Commons picture:


I simply used the free select tool to cut out the part (ctrl+x) and inserted it into another image without background.

However, when I export the project as PDF (File → Export as → Select file type → PDF), I get gray fringes around the border of the cut-out:



Closer look:



Why do these fringes appear? The image looks perfectly normal in GIMP, as shown in this picture:



Also in my default image viewer, when exported as PNG, the borders look perfectly normal:



Why do these fringes appear? Is there a way to remove them?

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Pierce403

4 Comments

Sorted by latest first Latest Oldest Best

 

@Lee3735518

Try something different: totally remove the white (so you only get the black lines):


Crop/edit the picture
Color>Color to alpha and remove the white background, to just keep the black lines.
Save as PNG

10% popularity Vote Up Vote Down


 

@Jamie315

The gray fringe appears at the boundary between "opaque white pixels" and "transparent pixels".

When you zoom in, GIMP is showing each pixel as a large square which is either white or transparent, so it appears to be OK.

When you zoom in a PDF document, the PDF engine smooths the image so that squares do not appear. So it has to smooth both the color (RGB channels) and opacity (the alpha channel). And here it surfaces that transparent pixels also must have some color to be interpolated. In most cases the "color" of transparent pixels turns out to be black. As a result, halfway between centers of white and transparent pixels you get a half opacity and a half-white, half-black color, which yields this very gray fringe.

One possibility to solve this is to make transparent pixels not fully transparent. In GIMP, add a new layer below the current one, fill it with white color, and make it "almost transparent" (opacity 1 of 255). It will become invisible to the eye. Then, flatten your image and export to PDF. Since the "transparent" pixels are now not fully transparent, they will retain their original white color which will always interpolate as white.

10% popularity Vote Up Vote Down


 

@Megan533

Simply convert this to vector as it looks solid black so could be done easily.

10% popularity Vote Up Vote Down


 

@Gretchen549

Try flattening the layers before export.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme