Convert Transparent TIF to Transparent PNG
Posted: 2014-03-11T11:22:26-07:00
Hello All,
We're trying to use ImageMagick to process layered Adobe RGB (1998) tif format files that have transparent areas surrounding and sometimes inside the active image area to Adobe RGB (1998) png format files while retaining the natural transparency of the tif file. The layered tifs are completely inconsistent when it comes to number of layers, alpha masks and paths, but they always have transparency around the active image area. Here are a couple of examples of what I see when I look at these files in PhotoShop CS6:


This is the code that our system developer started with:
convert $file -alpha off -flatten -quiet -format png /Volumes/RemoteFS/Test_Output/${file%.tif}.png
But this did not uniformly retain the tif transparency in our test of roughly 1600 files. The shoe bottom png was completely opaque and the void area in the hat was also opaque:

We tried to use clipping paths to isolate the transparency, but this will not work in all instances. Some images have a range of transparent pixels of anywhere from 0 to 99, so we just need to retain the native transparency found in the source tif file.
Can anyone point us in the right direction?
Thank you,
Ann
We're trying to use ImageMagick to process layered Adobe RGB (1998) tif format files that have transparent areas surrounding and sometimes inside the active image area to Adobe RGB (1998) png format files while retaining the natural transparency of the tif file. The layered tifs are completely inconsistent when it comes to number of layers, alpha masks and paths, but they always have transparency around the active image area. Here are a couple of examples of what I see when I look at these files in PhotoShop CS6:


This is the code that our system developer started with:
convert $file -alpha off -flatten -quiet -format png /Volumes/RemoteFS/Test_Output/${file%.tif}.png
But this did not uniformly retain the tif transparency in our test of roughly 1600 files. The shoe bottom png was completely opaque and the void area in the hat was also opaque:

We tried to use clipping paths to isolate the transparency, but this will not work in all instances. Some images have a range of transparent pixels of anywhere from 0 to 99, so we just need to retain the native transparency found in the source tif file.
Can anyone point us in the right direction?
Thank you,
Ann