Page 1 of 1

Tiff to PNG shows layer masks even though tiff is flattened

Posted: 2017-01-08T12:24:29-07:00
by dvint
So I have some images that were converted from RAW in Photoshop and several layer masks applied. I saved these files to tiff with no layers. Tiff image looks as expected. When I use the following command line, the resulting images shows a sort of negative b/w effect in the areas where the masks were applied.

convert Coxy-2016-10-22-0016-cr.tif -resize 800x800 out/Coxy-2016-10-22-0016-cr.png

If I change the format to JPG the images are much better, but several of the images show like random dead white pixels around the edge of the main mask.

Any idea what is going on? Also the process works fine with images that had layers, it just seems to be the mask that cause problems.

..dan

Re: Tiff to PNG shows layer masks even though tiff is flattened

Posted: 2017-01-08T13:38:22-07:00
by fmw42
What is your IM version and platform? Please always provide that, since syntax may vary? Please post your input and output images to some free hosting service such as dropbox.com and put the urls here, so we can test with your images.

Re: Tiff to PNG shows layer masks even though tiff is flattened

Posted: 2017-01-22T01:20:30-07:00
by dvint
So I was on Windows 8 when I first did this activity, I just moved to Windows 10 and ran it there now to find a file with this problem. All but one of the files seems to be working. the one example I can find is now a complete negative view. Here is the info I got back at the command line, nothing looks any different than the rest of the batch of files.

found: Y:/Images/2016/website-copyright/d001-08476.tif
CMD: convert Y:/Images/2016/website-copyright/d001-08476.tif -resize 800x800 out/d001-08476.png
convert.exe: Incompatible type for "RichTIFFIPTC"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/891.
convert.exe: Unknown field with tag 34864 (0x8830) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/891.
convert.exe: Unknown field with tag 34866 (0x8832) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/891.
convert.exe: Unknown field with tag 42033 (0xa431) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/891.
convert.exe: Unknown field with tag 42034 (0xa432) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/891.
convert.exe: Unknown field with tag 42036 (0xa434) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/891.
convert.exe: Unknown field with tag 42037 (0xa435) encountered. `TIFFReadCustomDirectory' @ warning/tiff.c/TIFFWarnings/891.
convert.exe: Incompatible type for "RichTIFFIPTC"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/891.

Looking at tiff file now it seems to have gotten damaged, but even sow, the results from the conversion do not match the tiff file.

You can find the before image (.tiff) and the output .png file here:

https://www.dropbox.com/sh/krjbz7k75i5p ... kQS5a?dl=0

Re: Tiff to PNG shows layer masks even though tiff is flattened

Posted: 2017-01-22T01:41:29-07:00
by fmw42
Your download only seems to get the PNG for me.

Re: Tiff to PNG shows layer masks even though tiff is flattened

Posted: 2017-01-22T10:51:29-07:00
by dvint

Re: Tiff to PNG shows layer masks even though tiff is flattened

Posted: 2017-01-22T11:49:01-07:00
by fmw42
Using IM 6.9.7.4 Q16 Mac OSX, this command works fine for me. The image is not color inverted.

Code: Select all

convert d001-08476.tif -resize 800x800 d001-08476.png
You get warnings about unknown meta tags, but you can ignore those or add -quiet after convert in your command to suppress them.

What is your Imagemagick version and what do you get from

Code: Select all

convert -version

Re: Tiff to PNG shows layer masks even though tiff is flattened

Posted: 2017-01-22T11:56:16-07:00
by dvint
version ImageMagick 6.9.3-7 Q16 x64 2016-03-06 on Windows 10 now

Re: Tiff to PNG shows layer masks even though tiff is flattened

Posted: 2017-01-22T12:01:04-07:00
by fmw42
It looks to me that your alpha channel is somehow getting inverted. But I do not get that effect. My result matches the input.

Perhaps try upgrading Imagemagick, libtif and libpng.

What are your versions of libtif and libpng? You can find them from

Code: Select all

convert -list format
Mine are:

PNG* PNG rw- Portable Network Graphics (libpng 1.6.24)

TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 4.0.6)