Menu

#379 GM writes color profile into grayscale images

v1.0_(example)
open
nobody
None
5
2016-11-19
2016-04-02
freshlydog
No

GraphicsMagick 1.3.23 2015-11-07 Q16 http://www.GraphicsMagick.org/

gm convert -flatten -colorspace gray test1.png test2.png

http://ipic.su/img/img7/fs/test1.1459623330.png
http://ipic.su/img/img7/fs/test2.1459623330.png

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2016-04-02

    It is ok to have a color profile in a grayscale image. I assume that the problem is that the original color profile is no longer the correct type for the image.

    If your original image has a color profile, then the correct way to convert to a gray image is using a color profile for the colorspace of the grey image with the -profile option. Otherwise you are only getting default Rec.601 behavior which assumes that the input colors match Rec.601.

     
  • Glenn Randers-Pehrson

    It is ok to have a color profile in a grayscale image

    The PNG specification doesn't allow that (I happen to think that that is an unnecessary restriction in the PNG spec, but it is what it is). The libpng16 decoder will reject it. Earlier versions of libpng don't inspect the iCCP chunk.

     
  • freshlydog

    freshlydog - 2016-04-03

    I looked closely: GM makes the RGB image, and without an option '-flatten' - grayscale + alpha.
    http://i.imgur.com/RemweSY.png

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-04-07

    If PNG does not allow color profiles for grayscale images then how can PNG support greyscales which are anything but a simple gamma curve?

     
  • freshlydog

    freshlydog - 2016-11-19

    I wanted grayscale image and used "-colorspace gray" option, but GM makes RGB image

     

Log in to post a comment.

MongoDB Logo MongoDB