Page 1 of 1

possible bug xc:color IM 6.9.7.7 Q16 Mac OSX

Posted: 2017-02-09T11:04:51-07:00
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.

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

Posted: 2017-02-09T11:34:26-07:00
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.

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

Posted: 2017-02-09T11:37:05-07:00
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.

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

Posted: 2017-02-09T11:49:26-07:00
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.

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

Posted: 2017-02-09T12:02:13-07:00
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

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

Posted: 2017-02-09T12:13:10-07:00
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.