Page 1 of 1

delegates.xml decode=ps:cmyk encode=png

Posted: 2007-06-12T06:33:41-07:00
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.

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

Posted: 2007-06-12T07:26:07-07:00
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.

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

Posted: 2007-06-13T00:17:15-07:00
by deniel
Thank you. It really helped me do what I wanted.