Page 1 of 1

Gray colorspace has no effect

Posted: 2009-07-23T03:21:01-07:00
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?

Re: Gray colorspace has no effect

Posted: 2009-07-23T05:49:26-07:00
by magick
Use MagickSetImageType() with GrayscaleType instead.