delegates.xml decode=ps:cmyk encode=png

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
deniel

delegates.xml decode=ps:cmyk encode=png

Post by deniel »

Hi, I need a way to select between using device pngalpha and bmpsep8 for ghostscript when converting eps to png(device=pngalpha) and for other raster formats: jpeg, tiff etc.(device=bmpsep8). The reason I want it like that is I want transparency preserver for png images, and use proper color convertion for other formats.

I tried with delegates:

here i tried png, and rgba as encode values but none did work.

Code: Select all

  <delegate decode="ps:cmyk" encode="rgba" command='"@PSDelegate@" -q -dSAFER -dPARANOIDSAFE -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=bmpsep8" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-g%s" "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s"' />
IM selects the delegate without the encode attribute:

Code: Select all

  <delegate decode="ps:cmyk" command='"@PSDelegate@" -q -dSAFER -dPARANOIDSAFE -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=bmpsep8" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-g%s" "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s"' />
Is it possible to do it like that? Or I'll need a second installation of IM which is not very desirable in my case.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: delegates.xml decode=ps:cmyk encode=png

Post by magick »

Try adding -colorspace RGB before your postscript filename on the command line. This forces the pngalpha Ghostscript device assuming it is defined in your delegates.xml configuration file.
deniel

Re: delegates.xml decode=ps:cmyk encode=png

Post by deniel »

Thank you. It really helped me do what I wanted.
Post Reply