Page 1 of 1

convert -alpha off creates strange TIFF

Posted: 2018-10-31T11:35:03-07:00
by Andi34
I completely remove the alpha channel of a TIFF resulting from a tool that will only output 4-channel TIFFs by

Code: Select all

convert inputimg -alpha off outputimg
(It seems to work well with the same file as input and output.)

The problem is that Mac OS' (10.11) Finder preview will only show a completely black file while Lightroom shows the correct file contents. On the other side, a TIFF with 3 channels, exported from Lightroom will appear correctly in preview.

Now I create a cropped TIFF from both files, from the original 4-channel and the 3-channel TIFF:

Code: Select all

convert 4channel.tif -crop 400x400+200+200 4channel_clip.tif
convert 3channel.tif -crop 400x400+200+200 3channel_clip.tif
Result is that both clipped files will show correctly in preview. So what is wrong with the TIFF file resulting from -alpha off? I don't want to create separate preview JPEGs for all my TIFFs.

Re: convert -alpha off creates strange TIFF

Posted: 2018-10-31T15:54:46-07:00
by fmw42
Many viewers will not display CMYK TIFF well unless there is a color profile imbedded. Is your original TIFF CMYKA or was it RGBA. When you remove the alpha it will leave the area under the alpha with the way the input was created. Often that means that those pixels were color/alpha, that is they were not the nominal black/alpha.

Typically at least with RGBA, when I want to remove the alpha, I set the alpha background to black first, like

Code: Select all

convert image -background black -alpha background -alpha off result
or

Code: Select all

convert image -background black -flatten result

________________

Please, always provide your IM version and platform when asking questions, since syntax may differ.

Also provide your exact command line and your images, if possible.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli


For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli

Re: convert -alpha off creates strange TIFF

Posted: 2018-11-04T17:24:42-07:00
by Andi34
It seems that Mac OS' Finder cannot deal with large TIFFs (in my case > 5000x3000) that are LZW compressed. The "enfuse" utility creating the original file produced an LZW compressed 4-channel 16-bit TIFF (despite called with --compression=none) which is a bad choice. identify -verbose is very helpful finding such issues.