Inconsistent transparencies when converting tif to png
Posted: 2014-03-05T16:16:22-07:00
Hello all--
I am using ImageMagick to convert tif files with clipping paths to png files. Here is the command that I have been using, and it generally works fine:
convert testfile_01.tif -alpha transparent -clip -alpha opaque -strip -format png -quiet testfile_01.png
The idea is to preserve the transparencies in the tif input when converting to the png format. I am finding that some areas are being converted to white backgrounds instead of transparent backgrounds. The problem is not consistent, but there is a common thread. If the transparent area is completely surrounded by opaque image, it may or may not convert properly. I also find that the same areas in a given image fail every time. Some images exhibit the problem while others do not.
Here is an example:

As you can see, the area outside of the bag handles is transparent, but the area inside the handles is not, and it should be.
The original tif file can be found here: https://dl.dropboxusercontent.com/u/354 ... ile_01.tif
I am using the following version on Red Hat Enterprise Linux Server release 6.5:
Version: ImageMagick 6.5.4-7 2012-04-10 Q16 OpenMP http://www.imagemagick.org
Any suggestions are welcome. Thank you very much for your help.
I am using ImageMagick to convert tif files with clipping paths to png files. Here is the command that I have been using, and it generally works fine:
convert testfile_01.tif -alpha transparent -clip -alpha opaque -strip -format png -quiet testfile_01.png
The idea is to preserve the transparencies in the tif input when converting to the png format. I am finding that some areas are being converted to white backgrounds instead of transparent backgrounds. The problem is not consistent, but there is a common thread. If the transparent area is completely surrounded by opaque image, it may or may not convert properly. I also find that the same areas in a given image fail every time. Some images exhibit the problem while others do not.
Here is an example:

As you can see, the area outside of the bag handles is transparent, but the area inside the handles is not, and it should be.
The original tif file can be found here: https://dl.dropboxusercontent.com/u/354 ... ile_01.tif
I am using the following version on Red Hat Enterprise Linux Server release 6.5:
Version: ImageMagick 6.5.4-7 2012-04-10 Q16 OpenMP http://www.imagemagick.org
Any suggestions are welcome. Thank you very much for your help.