-depth 8 does not match Photoshop

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
msundell
Posts: 13
Joined: 2013-12-17T00:53:52-07:00
Authentication code: 6789

-depth 8 does not match Photoshop

Post by msundell »

Trying to adjust -depth conversion from 16 bit to 8 bit for TIFF to match Photoshop, for some reason values does not end up the same. Can't say for sure why AND I haven't tried all operators with -depth so I'm asking for some help here. Take a look at the attached screenshot.

Image

What we see is edges being compared, the values are printed out along with the type of conversion to the right. The first example does it well, preserves values after conversion to 8 bit, the second and the third one comes from convert using -depth 8 only from 16 bit input. The forth is the 16 bit input, original values. The last one is a JPG converted from the -depth 8 bit converted file.

How can I tweak the -depth scaling to better match Photoshop, will keep digging but hoping for a quick push in the right direction :)

Thanks!
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: -depth 8 does not match Photoshop

Post by glennrp »

It would help to know the 16-bit values of those two pixels in the original 16-bit file. Someone else will probably ask what version of ImageMagick you are using.
msundell
Posts: 13
Joined: 2013-12-17T00:53:52-07:00
Authentication code: 6789

Re: -depth 8 does not match Photoshop

Post by msundell »

ImageMagick version: ImageMagick-6.7.6-4-Q16_x64

Values in the example:
8-bit values: First example: 254,247 (right to left) << Expected values after 16 to 8 bit in Photoshop
8-bit values: Second example: 255,254 (right to left) << Values after convert -depth 8
16-bit values: Forth example ORIGINAL: 254,248 (right to left) << Original TIFF
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: -depth 8 does not match Photoshop

Post by glennrp »

Those don't look like 16-bit values. I'd expect numbers like 65278 instead of 254 and 63736 instead of 248.
Post Reply