Page 1 of 1

PS to GIF conversion producing poor results

Posted: 2009-08-06T19:45:00-07:00
by naoliv
Hi!

From http://bugs.debian.org/536892
Using this file and running convert -density 240 -trim input.ps output.gif, we are seeing a poor result if compared with ImageMagick 6.2.4-5
With the older version we have this, while with newer versions we see this.

I can see the same poor result with latest 6.5.4-9
Did something change when encoding a GIF file?

Thank you.

Re: PS to GIF conversion producing poor results

Posted: 2009-08-07T09:55:03-07:00
by magick
Try this command:
  • convert -density 240 input.ps -trim -flatten output.gif
If that does not produce similar results, edit delegates.xml and change the pngalpha Ghostscript device to pnmraw and see if that fixes the problem.

Re: PS to GIF conversion producing poor results

Posted: 2009-08-07T10:10:06-07:00
by naoliv
With --flatten it did work as expected.
Will this behavior be changed or it will be necessary to always include --flatten, please?

Re: PS to GIF conversion producing poor results

Posted: 2009-08-07T10:30:50-07:00
by magick
ImageMagick must choose a Ghostscript device based on the attributes of the Postscript file. If the image is EPS we use the pngalpha device since many EPS images have transparency. If you don't want transparency, use -flatten as recommended which composites the transparent image onto the image background color.

Re: PS to GIF conversion producing poor results

Posted: 2009-08-15T07:20:17-07:00
by naoliv
Hi!

From another user:
Please consider that adding -flatten parameter is not a solution for all
purposes, because transparency is often needed in output images.

Re: PS to GIF conversion producing poor results

Posted: 2009-08-17T05:01:00-07:00
by Heiler81
Please consider that adding -flatten parameter is not a solution for all
purposes, because transparency is often needed in output images.
Well gif didnĀ“t support Alpha Channels so if you got some and you want a gif you need flatten etc. Same problem also in other formats (jpeg, .....).

Workaround: First check what you got in picture and than check what the new picture will support.

Re: PS to GIF conversion producing poor results

Posted: 2011-06-21T12:14:17-07:00
by fmw42
inkdroplet wrote:
magick wrote:ImageMagick must choose a Ghostscript device based on the attributes of the Postscript file. If the image is EPS we use the pngalpha device since many EPS images have transparency. If you don't want transparency, use -flatten as recommended which composites the transparent image onto the image background color.
This is my last bumped thread I promise. The search feature has been my best friend today. My question for you Magick, is the flatten command the same thing as rasterizing a layer like in Photoshop? Instead of answering the question because I have a lot of wonder, maybe just a link to the command description or something would be very helpful. Thanks so much, and I apologize for reviving a couple of old topics, but I have been learning a ton.
I hope this is what you are looking for:

see Anthony's Examples
http://www.imagemagick.org/Usage/layers/#flatten

and descriptions of -layers flatten at
http://www.imagemagick.org/script/comma ... php#layers

-flatten is a shortcut for -layers flatten

Re: PS to GIF conversion producing poor results

Posted: 2011-09-04T22:57:30-07:00
by Jorge
It took me quite long to go deeply into positioning of layered images, but without the instructions it'd much worse. Thanks, fmw42!

Re: PS to GIF conversion producing poor results

Posted: 2011-09-15T21:17:44-07:00
by anthony
-flatten basically generates a background color image the same size as the virtual canvas of the first image.
It then composites every image onto this background.

If multiple images are not involved then it essentially replaces any transparency with the default background color 'white'.

An alternative if you want to preserve multiple images is to use -boardcolor white -border 0 . This may not seem 'sensible' but it does basically the same thing, compose the image onto a white fully-opaque background to remove all transparency.

The other differences is that -border uses a different color setting, keeps multiple images separate, and it uses the images real dimensions instead of the the virtual canvas and offset.