Reputation: 360
Currently I am running this command on a CentOs Unix server with ImageMagick version 6.7.2-7.
convert Test.tif -channel All -separate -resize 50% -background none -alpha copy -combine Test10.tif
It is doing everything I need it to - but it is adding a white background to each of the Channels as shown here: the test file before and after the command as shown in Photoshop CS4
I have tried lots of different settings for alpha background etc but I cannot get it to retain the transparency on the RGB channels. This is the test file if you want to check it out
I don't know if it needs me to run this command and specify a profile - its so close to being right - it could be something very simple but I can't find anyone mentioning this specific issue with .tif?
Thanks in advance.
Outcome After the first suggestion by fmw42 - run on Windows 7 Professional Version: ImageMagick 7.0.8-25 Q16 x64
Upvotes: 0
Views: 318
Reputation: 53089
This seems to work for me in Imagemagick 6.9.10.25 Q16 Mac OSX
convert -quiet \( test.tif[0] -channel alpha -negate +channel \) test.tif[1] -background none -layers merge -resize 50% test_result.tif
http://www.fmwconcepts.com/misc_tests/tif_proc/test_resize.tif
The issue is that Imagemagick does not handle background transparency in TIF files as cleanly as it could. In Photoshop you have one layer with background transparency. But Imagemagick sees two layers. The first has transparency (but is the wrong polarity and needs to be inverted). It is full size. But the second layer also contains transparency and is not the full size of the first layer. So one has to negate the first layer, use -layers merge to composite the second over the first in the correct offset and then resize. Imagemagick references layers starting with index 0 as in [0].
Windows syntax is slightly different (remove the \s):
convert -quiet ( test.tif[0] -channel alpha -negate +channel ) test.tif[1] -background none -layers merge -resize 50% test_result.tif
If in a .bat file, you need to double the % to %%.
Upvotes: 1