Page 1 of 1

EPS with alpha resized -> JPEG, gets black background

Posted: 2007-06-05T05:00:12-07:00
by deniel
Hi, i have configured ghostscript in delegates.xml to use pngalpha device for all ps files. It works ok when i save to png, bmp, jpg (png is transparent, bmp, jpg have white background) but when i add -resize to the convert command i get black background in the bmp and jpeg files.

convert -verbose rhythm_in_yellow.ps rhythm.jpg -> OK
convert -verbose -density 72 rhythm_in_yellow.ps -resize 1000 rhythm.jpg -> black background

convert -verbose -density 72 rhythm_in_yellow.ps -background white -flatten -resize 1000 rhythm.jpg -> OK

the file i'm testing with is http://rhythm.bg/logo/rhythm_in_yellow.eps

I'm using 6.3.3 and 6.3.4 q16.

Thanks.

Re: EPS with alpha resized -> JPEG, gets black background

Posted: 2007-06-05T11:55:20-07:00
by magick
Try this command:
  • convert -verbose -colorspace rgb -density 72 rhythm_in_yellow.ps -resize 1000 rhythm.jpg

Re: EPS with alpha resized -> JPEG, gets black background

Posted: 2007-06-05T19:01:26-07:00
by anthony
If you image has alpha, the resize will produce balck backgroudn as JPEG does not save alpha or transparency!

-flatten the image onto a -background color before saving to JPEG.
See http://www.imagemagick.org/Usage/formats/#jpg_trans

Re: EPS with alpha resized -> JPEG, gets black background

Posted: 2007-06-05T23:50:52-07:00
by deniel
magick wrote:Try this command:
  • convert -verbose -colorspace rgb -density 72 rhythm_in_yellow.ps -resize 1000 rhythm.jpg
No that didn't work for me. I solved my problems with the flatten and background solution. But the other problem is that it's not interpolated right when not using flatten and background.

convert -verbose -colorspace rgb -density 72 rhythm_in_yellow.ps -resize 1000 -interpolate bilinear rhythm_3.png

Image

Thank you both for the help.