Page 1 of 1
IM 6.0.7 coloring transparency in png to jpg fails
Posted: 2007-11-12T06:48:16-07:00
by Paramäleon
I tried the following:
convert file.png -background \#FFFFFF -flatten -resize '192x128>' -quality 50 small.jpg
to convert a PNG file with transparency to JPG. The transparent area stays black in the result however. What's wrong?
Re: IM 6.0.7 coloring transparency in png to jpg fails
Posted: 2007-11-12T18:55:37-07:00
by fmw42
Try this and go from there. This works. Learned it from Anthony Thyssen
Recoloring transparent areas
# create test image (red square surrounded by black)
convert -size 100x100 xc:red -bordercolor black -border 50 tmp.png
# to make red transparent
convert tmp.png -transparent red tmp1.png
# to make transparent red (-opaque is -channel effected)
convert tmp1.png -channel RGBA -fill red -opaque none tmp2.jpg
Re: IM 6.0.7 coloring transparency in png to jpg fails
Posted: 2007-11-13T04:36:38-07:00
by Paramäleon
It finally goes! Whow, great. Thanks a lot!
Note that images without transparency get disrupted by this, so it can't be used in batch on mixed sources!
Everybody please note, too, that I took the failing way using the -flatten operator from some manual here on PNG to JPG, which is obviously wrong then. Maybe someone wants to update that...
Re: IM 6.0.7 coloring transparency in png to jpg fails
Posted: 2007-11-19T18:42:58-07:00
by anthony
Your real problem however is you IM is very very old. At least 3 to 4 years old. I suggest you upgrade before you start complaining about the many other problems that have long since been fixed.