no alpha channel after resizing of a tiff file

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
_DK_
Posts: 5
Joined: 2012-07-23T09:28:26-07:00
Authentication code: 15

no alpha channel after resizing of a tiff file

Post by _DK_ »

Hi,

I have a tiff file in phososhop with 4 channels (RGBA), once it's converted all the channels are mixed and I can only see 3 channels (RGB and A is gone).

I tried different options and even the one that is supposed to force alpha still doesn't work:

imagemagick\6.6.7-Q16\convert.exe test-alpha.tif -resize 512x512 -type TrueColorMatte -alpha On alpha-512.tif

Could you please give any hints? thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: no alpha channel after resizing of a tiff file

Post by fmw42 »

try

convert.exe test-alpha.tif -resize 512x512 alpha-512.tif

convert.exe test-alpha.tif -resize 512x512 -type TrueColorMatte alpha-512.tif

I don't believe you need -alpha on and if you did, it probably should be right after the input image. Also you don't need -type in this case if the input is 32-bits and not 8-bits with transparency

If you post a link to your image, others can test as it may be a problem with your input tif. It might also be a bug in your IM version, which is a bit old.

On IM 6.7.8.6 Q16 Mac OSX Snow Leopard, I don't have any problem.

# create large transparent tif
convert logo: -resize 200% -transparent white logo200.tif

# process it
convert logo200.tif -resize 512x512 logo200_tmp1.tif
or
convert logo200.tif -resize 512x512 -type truecolormatte logo200_tmp2.tif


Both results show an alpha channel for the output.
_DK_
Posts: 5
Joined: 2012-07-23T09:28:26-07:00
Authentication code: 15

Re: no alpha channel after resizing of a tiff file

Post by _DK_ »

Ok, tried the latest version:

ImageMagick-6.7.8-6\convert.exe test-alpha.tif -resize 128x128 alpha-128.tif

And am getting: convert.exe: Incompatible type for "RichTIFFIPTC"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/820.

alpha-128.tif is still showing 3 channels only in photoshop. test-alpha was created in photoshop too (I assume it must have written the correct header).

Here're the files: http://narod.ru/disk/57731551001.6bb800 ... k.zip.html (sorry about this site, if you point me to any free file hosting - I'd reupload there)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: no alpha channel after resizing of a tiff file

Post by fmw42 »

I tested your image and command and the output does have an alpha channel that shows in both IM and Photoshop CS for me. The warning you get is only a warning and not an error. Some tiff tag is there that IM does not understand and just skips with a warning.

I am using IM 6.7.8.6 Q16 Mac OSX Snow Leopard


You might try again by adding -strip to the command and see if that changes anything. Otherwise, it could be an IM bug only on Windows.

It could also be the version of libtiff you are using. I am using LIBTIFF, Version 3.9.5

You might be able to see what version you have by typing

convert -list format

and look at the line for TIFF
_DK_
Posts: 5
Joined: 2012-07-23T09:28:26-07:00
Authentication code: 15

Re: no alpha channel after resizing of a tiff file

Post by _DK_ »

Thanks for replying again. I tried the "strip" option and nothing changed.

Have a look here: http://oi47.tinypic.com/2igyxkp.jpg
It does show in the header it's a 32 bit image but for some reason alpha channel is gone (i.e. can't use it for other purposes)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: no alpha channel after resizing of a tiff file

Post by fmw42 »

Sorry, all I can say is that when I tried it on my Mac in IM 6.7.8.6 Q16, the alpha channel was in the output image as seen in PS CS. Sorry I only have that old version.

Perhaps some other windows user with PS can test your command and image.
tafkaks
Posts: 12
Joined: 2012-10-10T06:34:28-07:00
Authentication code: 67789

Re: no alpha channel after resizing of a tiff file

Post by tafkaks »

Just to add in a "me too", I'm suffering the same issue with photoshop and tiff's written out via IM. Details here:

viewtopic.php?f=3&t=22037
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: no alpha channel after resizing of a tiff file

Post by fmw42 »

You may need to upgrade your IM as per Magick's reply that it works for him on 6.7.9.10
NeoVitru
Posts: 1
Joined: 2013-02-06T13:46:29-07:00
Authentication code: 6789

Re: no alpha channel after resizing of a tiff file

Post by NeoVitru »

You can use -quite to suppress the warning msg - fmw42 suggested
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: no alpha channel after resizing of a tiff file

Post by fmw42 »

NeoVitru wrote:You can use -quite to suppress the warning msg - fmw42 suggested

That would be -quiet rather than -quite. I suspect just a typo from NeoVitru.

See http://www.imagemagick.org/Usage/basics/#controls
Post Reply