Page 1 of 1
PNG Transparency to JPG - Halo Ring Problem
Posted: 2012-04-06T10:47:59-07:00
by rendermagic
I'm stuck and can't figure out how to get a transparent PNG to convert to a JPG. When I do a straight convert, I get this strange grey halo around the outer edge of the object in the image.
Ultimately, I'm trying to take my transparent PNG, apply a white background, and convert it to a JPG. I followed this
Any ideas?
Source Original PNG Image:
http://www.carametrix.com/ExampleImageSource.png
Resulting Problem JPG Image:
http://www.carametrix.com/ExampleImageResult.jpg
Re: PNG Transparency to JPG - Halo Ring Problem
Posted: 2012-04-06T11:00:39-07:00
by fmw42
try
convert ExampleImageSource.png +repage -background white -flatten ExampleImageSource.jpg
see
http://www.imagemagick.org/Usage/layers/#flatten
The +repage is needed to remove the virtual canvas on your png so that your jpg does not have a lot of extra white space all around it.
Re: PNG Transparency to JPG - Halo Ring Problem
Posted: 2012-04-06T11:46:02-07:00
by rendermagic
Wow...that worked! That was incredibly helpful. Thank you for your help.
Re: PNG Transparency to JPG - Halo Ring Problem
Posted: 2012-04-08T17:05:15-07:00
by anthony
The correct way is to use
-alpha remove
See Removing Transparency from Images
http://www.imagemagick.org/Usage/masking/#remove
The flatten method works though uses more memory and processing and can go wrong in specific situations as you are applying a operator that is not actually designed for removing transparency, it is just a side-effect of what its real purpose is.
Re: PNG Transparency to JPG - Halo Ring Problem
Posted: 2012-04-08T17:16:25-07:00
by fmw42
anthony wrote:The correct way is to use -alpha remove
Perhaps you should mention at what version of IM -alpha remove was added. Is it not relatively recent (6.7.5.x), but what minor version? Changelog says 6.7.5-1
P.S. It is not even listed as an option at
http://www.imagemagick.org/script/comma ... .php#alpha