Page 1 of 1

convert with -depth8, but the output is # ImageMagick pixel enumeration: 500,500,65535,srgb

Posted: 2019-04-03T09:54:28-07:00
by ddosimg
Hi, when i convert an image with "-depth 8", the result was ''# ImageMagick pixel enumeration: 500,500,65535,srgb".

[cmd] convert artwork.png -depth 8 -colorspace srgb -alpha off txt:-
[output] # ImageMagick pixel enumeration: 500,500,65535,srgb


Platform:
Macbook Pro
System Version: macOS 10.14.3 (18D109)
Kernel Version: Darwin 18.2.0
Imagemagick Version: ImageMagick 6.9.10-27 Q16 x86_64 2019-02-15 https://imagemagick.org

===============

Howerver, the result was right in my docker container.

[cmd] convert artwork.png -depth 8 -colorspace srgb -alpha off txt:-
[output] # ImageMagick pixel enumeration: 500,500,255,srgb

Platform:
VERSION="Ubuntu 16.04.5 LTS (Xenial Xerus)"
Imagemagick Version: ImageMagick 6.8.9-9 Q16 x86_64 2018-09-28 http://www.imagemagick.org

Can anyone help me with this problem?

ps.
image info:
[cmd] identify artwork.png
[output] artwork.png PNG 500x500 500x500+0+0 8-bit sRGB 218890B 0.000u 0:00.000

Re: convert with -depth8,but output was # ImageMagick pixel enumeration: 500,500,65535,srgb

Posted: 2019-04-03T10:00:09-07:00
by fmw42
ImageMagick txt: reports values in the Quantum depth of your install, not according to your depth. So if you are on Q16, it will report 65535. If on Q8, it will report 255

On my Q16 ImageMagick,
convert logo: -depth 8 txt:
# ImageMagick pixel enumeration: 640,480,65535,srgb
0,0: (65535,65535,65535) #FFFFFF white
...

However, if the last value is not a color name it will be reported as srgb(r,g,b) with r,g,b in range 0 to 255.

Re: convert with -depth8,but output was # ImageMagick pixel enumeration: 500,500,65535,srgb

Posted: 2019-04-03T18:52:45-07:00
by ddosimg
fmw42 wrote: 2019-04-03T10:00:09-07:00 ImageMagick txt: reports values in the Quantum depth of your install, not according to your depth. So if you are on Q16, it will report 65535. If on Q8, it will report 255

On my Q16 ImageMagick,
convert logo: -depth 8 txt:
# ImageMagick pixel enumeration: 640,480,65535,srgb
0,0: (65535,65535,65535) #FFFFFF white
...

However, if the last value is not a color name it will be reported as srgb(r,g,b) with r,g,b in range 0 to 255.
So, the numbers in the first parenthesis is dependent on the version of ImageMagick(Q8 or Q16), and the last value is dependent on the flag of -depth?
eg.
# ImageMagick pixel enumeration: 640,480,65535,srgb
0,0: (65535,65535,65535) #FFFFFF srgb(255,255,255)
...

Re: convert with -depth8, but the output is # ImageMagick pixel enumeration: 500,500,65535,srgb

Posted: 2019-04-03T19:41:06-07:00
by fmw42
The last value should always be in the range 0-255 if not a color name.

Re: convert with -depth8, but the output is # ImageMagick pixel enumeration: 500,500,65535,srgb

Posted: 2019-04-03T21:03:47-07:00
by ddosimg
fmw42 wrote: 2019-04-03T19:41:06-07:00 The last value should always be in the range 0-255 if not a color name.
This has confused me for a few days.
Thank you for your help today. :D

Re: convert with -depth8, but the output is # ImageMagick pixel enumeration: 500,500,65535,srgb

Posted: 2019-04-03T21:13:19-07:00
by fmw42
The last value should always be in the range 0-255 if not a color name.
There are exceptions such as when hue is involved and then you will get % values.

Code: Select all

convert xc:red -colorspace hsl txt:
# ImageMagick pixel enumeration: 1,1,65535,hsl
0,0: (0,65535,32768) #0000FFFF8000 hsl(0,100%,50%)