Page 1 of 1

Posted: 2006-09-11T13:49:05-07:00
by magick
If ghostscript had one robust device to handle RGB, RGBA, CMYK, and CMYKA image types (RGB and CMYK with and without transparency) ImageMagick would be able to render Postscript to an image format quite robustly. However, ImageMagick has to select from different devices based on what it sees in the Postscript document. It chooses the device conservatively to ensure the conversion is proper for a great majority of Postscript documents. The devices available include a monochrome device, a RGB device, a RGBA device, and a CMYK device. Given that, to fix this problem you need a Ghostscript version that supports the RGBA device (pngalpha) at the time ImageMagick is built. Type
  • gs -h
and look for pngalpha. Also ensure this device is specified in the ImageMagick delegates.xml file:
  • <delegate decode="ps:alpha" stealth="True" command='"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -dEPSCrop "-sDEVICE=pngalpha" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-g%s" "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s"' />
Next, ImageMagick requires the LanguageLevel DCS comment in the Postscript file. We added
  • %%LanguageLevel: 3
to clipart2.eps and it converted as expected (a man with a camera with a transparent background):
  • convert -colorspace rgb clipart2.eps clipart.gif
Another solution is to change all references of pnmraw to pngalpha in
  • /usr/local/lib/ImageMagick-6.2.9/config/delegates.xml