Hi all,
Using Magick++, I'm trying to resize a TGA image using the scale method.
( binairies ImageMagick-6.2.9-0-Q8-windows
-dll.exe )
Here is the simple code:
{
Image SrcImage;
SrcImage.read("SourceImage.tga");
Image DstImage;
DstImage = SrcImage;
(or "Image DstImage(SrcImage);", same behavior)
DstImage.scale(50%);
DstImage.write("DstImage.tga");
}
This works well for RGB and RGBA TGA files, but not for Grayscale TGA.
The Grayscale TGA are converted to RGBA TGA.
I've done some tests to debug, but the results look strange to me:
-using the "identify -verbose" command line tool for a grayscale
image, I get a GrayScaleMatte type, and a Gray Colorspace
-but using the Image.type() and Image.colorSpace() methods, I get a
GrayScaleMatte type, and a RGB Colorspace
-If, just after reading the source image, I write it on the disk:
"SrcImage.write("SourceImage_Backup.tga");" The file is not converted
to a RGBA TGA, but to a Gray Colorspace and GrayScale Type file.
-If, I try to set the Colorspace of the DstImage to GRAYColorspace,
the colorspace doesn't seem to be modified.
Note: The Grayscale source images are of GrayScaleMatte type because
the Image contains a 1 bit alpha channel always set to one. (don't
know why, ask Photoshop).
Well, any help would be very very appreciated. Thank a lot!
Cheers,
Pierre
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users