Page 1 of 1

Appending two TIFs modifies hex values?

Posted: 2017-08-04T08:42:03-07:00
by mtcarlso
Howdy -

I'm appending two (identical) TIFF files - https://drive.google.com/drive/folders/ ... sp=sharing - and the resulting image seems to have changed one of the hex values for a particular shade of pink from #ff67bd to #fe67bc

I'm using the CLI. Here are the two commands I have tried:
convert +append bmp_tests/0803_export_0.tif +append bmp_tests/0803_export_1.tif +append +compress tif_to_tif_plus.tif
convert +append bmp_tests/0803_export_0.tif +append bmp_tests/0803_export_1.tif +append -compress None tif_to_tif_plus.tif

Both results are the same. Am I using or misunderstanding the compression flag incorrectly?

Many thanks for your help!

Version: ImageMagick 6.9.6-5 Q16 x86_64 2016-11-15

Re: Appending two TIFs modifies hex values?

Posted: 2017-08-04T09:40:34-07:00
by fmw42
I do not know if this will help, but proper IM 6 syntax is to read the two images first, then the command +append. So

Code: Select all

convert 0803_export_0.tif 0803_export_1.tif +append -compress None result.tif
Both input images have 55 colors and so does the output. I cannot say if any have changed. How did you measure that.

I extracted the unique colors and did a compare and they are exactly the same.

Code: Select all

convert -quiet 0803_export_0.tif -unique-colors 1.png
convert -quiet 0803_export_1.tif -unique-colors 2.png
compare -metric rmse 1.png 2.png null:
0 (0)
Using IM 6.9.9.4 Q16 Mac OSX Sierra

Re: Appending two TIFs modifies hex values?

Posted: 2017-08-04T10:49:46-07:00
by mtcarlso
I see what you mean re: the same colors from the console. I am seeing the same (and thank you for the syntax recommendation).

I have to pull these images into Gimp afterwards to reindex the colormap afterwards (long story), and that was where I was seeing the colors come in differently after append. Something changes enough that their interpretation shifts them just slightly (and to a value similar enough that the colors get indexed incorrectly after my fix).

Something about them is causing both Gimp and Photoshop to interpret the colors differently before and after append. Which, unless there is an obvious change in the before-and-after image profiles that I am not seeing, may be more of a Gimp/PS problem...

Any thoughts?

Re: Appending two TIFs modifies hex values?

Posted: 2017-08-04T12:10:06-07:00
by fmw42
Possibly GIMP/PS is assigning different profiles to each, though I have my doubts it would do that.

I suppose IM or GIMP/PS could be modifying the colors to reassign them differently though keeping the same unique colors. But that seems strange to me also.

Re: Appending two TIFs modifies hex values?

Posted: 2017-08-04T12:51:18-07:00
by snibgo
mtcarlso wrote:... changed one of the hex values for a particular shade of pink from #ff67bd
According to "identify -verbose 0803_export_0.tif", the image is 16 bits/channel. So no pixels have the value #ff67bd. 5470 pixels do have the value #FF006700BD00.
mtcarlso wrote:Something about them is causing both Gimp and Photoshop to interpret the colors differently before and after append.
Are Gimp are PS reading the images as 8-bit? That would explain the problem.