possible bug xc:color IM 6.9.7.7 Q16 Mac OSX

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug xc:color IM 6.9.7.7 Q16 Mac OSX

Post by fmw42 »

.
Creating icc-colors with alpha is losing the alpha value.

Code: Select all

convert xc:"icc-color(srgb,1,0,0.5,0.2)" redalpha.png
alpha = 0.2 in the above

identify -verbose redalpha.png

Code: Select all

Image: redalpha.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 1x1+0+0
  Units: Undefined
  Type: Palette
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 16-bit
  Channel depth:
    red: 1-bit
    green: 1-bit
    blue: 16-bit
  Channel statistics:
    Pixels: 1
    Red:
      min: 65535 (1)
      max: 65535 (1)
      mean: 65535 (1)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
      entropy: nan
    Green:
      min: 0 (0)
      max: 0 (0)
      mean: 0 (0)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
      entropy: nan
    Blue:
      min: 32768 (0.500008)
      max: 32768 (0.500008)
      mean: 32768 (0.500008)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
      entropy: nan
  Image statistics:
    Overall:
      min: 0 (0)
      max: 65535 (1)
      mean: 32767.7 (0.500003)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
      entropy: nan
There is no alpha channel.


Same is happening with srgb color as follows:

Code: Select all

convert xc:"srgb(100%,0%,50%,0.2)" redalpha.png
identify -verbose redalpha.png

Code: Select all

Image: redalpha.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 1x1+0+0
  Units: Undefined
  Type: Palette
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 16-bit
  Channel depth:
    red: 1-bit
    green: 1-bit
    blue: 16-bit
  Channel statistics:
    Pixels: 1
    Red:
      min: 65535 (1)
      max: 65535 (1)
      mean: 65535 (1)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
      entropy: nan
    Green:
      min: 0 (0)
      max: 0 (0)
      mean: 0 (0)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
      entropy: nan
    Blue:
      min: 32768 (0.500008)
      max: 32768 (0.500008)
      mean: 32768 (0.500008)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
      entropy: nan
  Image statistics:
    Overall:
      min: 0 (0)
      max: 65535 (1)
      mean: 32767.7 (0.500003)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
      entropy: nan
EDIT: As snibgo points out below, in xc:"srgb(...)", I should have used xc:"srgba(...)". So no issue here.

Also he points out below a question as to whether icc-colors support alpha values. Of that I am not sure. So perhaps the IM developers can explain if it is suppose to be supported or not.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: possible bug xc:color IM 6.9.7.7 Q16 Mac OSX

Post by snibgo »

Could icc-color ever include alpha? Going back to 6.8.9-0, it couldn't. I can't find any documentation that says it should.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug xc:color IM 6.9.7.7 Q16 Mac OSX

Post by fmw42 »

http://www.imagemagick.org/script/color.php does not say one way or the other. But I am having the same trouble (edited above) with simply

xc:"srgb(100%,0%,50%,0.2)"

which should work.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: possible bug xc:color IM 6.9.7.7 Q16 Mac OSX

Post by snibgo »

I thought we should use one of these:

xc:"srgb(100%,0%,50%)" <== srgb takes no alpha
xc:"srgba(100%,0%,50%,0.2)" <== srgba takes alpha

But I can't find the documentation for this.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug xc:color IM 6.9.7.7 Q16 Mac OSX

Post by fmw42 »

snibgo wrote: 2017-02-09T11:49:26-07:00 I thought we should use one of these:

xc:"srgb(100%,0%,50%)" <== srgb takes no alpha
xc:"srgba(100%,0%,50%,0.2)" <== srgba takes alpha

But I can't find the documentation for this.
DOH! :oops: srgbA

Thanks. I do not know where my head is this morning.

color documentation is at http://www.imagemagick.org/script/color.php
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug xc:color IM 6.9.7.7 Q16 Mac OSX

Post by fmw42 »

On those same lines, I just tried adding a to srgb in the icc-color, but that failed

Code: Select all

convert xc:"icc-color(srgba,1,0,0.5,0.2)" redalpha.png
convert: unrecognized color `icc-color(srgba,1,0,0.5,0.2)' @ warning/color.c/QueryMagickColorCompliance/2764.
convert: no images defined `redalpha.png' @ error/convert.c/ConvertImageCommand/3258.


So I have to assume (as snibgo suggested) that icc-colors do not support alpha.
Post Reply