Gray colorspace has no effect

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
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Gray colorspace has no effect

Post by mkoppanen »

Version: ImageMagick 6.5.4-3 2009-07-21 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

Test code:

Code: Select all

#include <stdio.h>
#include <wand/MagickWand.h>

int main()
{
        MagickWand *wand;
        MagickWandGenesis();

        wand = NewMagickWand();

        MagickReadImage(wand, "magick:rose");
        MagickSetImageColorspace(wand, GRAYColorspace);

        MagickWriteImage(wand, "test_gray.png");
        wand = DestroyMagickWand(wand);

	MagickWandTerminus();
        return 0;
}
After:

Code: Select all

$ identify -verbose test_gray.png | grep Colorspace
  Colorspace: RGB
Am I doing something wrong?
Mikko Koppanen
My blog: http://valokuva.org
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Gray colorspace has no effect

Post by magick »

Use MagickSetImageType() with GrayscaleType instead.
Post Reply