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

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
ddosimg
Posts: 10
Joined: 2019-03-19T02:14:53-07:00
Authentication code: 1152

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
ddosimg
Posts: 10
Joined: 2019-03-19T02:14:53-07:00
Authentication code: 1152

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

Post 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)
...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

The last value should always be in the range 0-255 if not a color name.
ddosimg
Posts: 10
Joined: 2019-03-19T02:14:53-07:00
Authentication code: 1152

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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%)
Post Reply