Code: Select all
$ ./test_colorspace
ImageMagick 6.4.7 2008-12-17 Q16 http://www.imagemagick.org
Original Colorspace = 1
New Colorspace = 2
Code: Select all
$ ./test_colorspace
ImageMagick 6.4.8-9 2009-01-24 Q16 http://www.imagemagick.org
Original Colorspace = 1
New Colorspace = 1
Please let me know if you need more information.
Here's the test program:
Code: Select all
/*
gcc `Magick-config --cflags --cppflags` test_colorspace.c `Magick-config --ldflags --libs` -o test_colorspace
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <magick/MagickCore.h>
int main(int argc,char **argv)
{
ImageInfo *info;
Image *image;
MagickCoreGenesis(argv[0], MagickFalse);
puts(GetMagickVersion(NULL));
info = CloneImageInfo(NULL);
image = AcquireImage(info);
SetImageExtent(image, 20, 20);
printf("Original Colorspace = %d\n", image->colorspace);
SetImageColorspace(image, GRAYColorspace);
printf("New Colorspace = %d\n", image->colorspace);
DestroyImageInfo(info);
DestroyImage(image);
MagickCoreTerminus();
exit(0);
}