Grayscale Image Objects
[email protected] Wed, 31 Dec 2008 15:07:12 -0600
| Newsgroups | gmane.comp.video.graphicsmagick.apis |
|---|---|
| Message-ID | <OF3E091B45.626F3E0A-ON86257530.00730B33-86257530.00744970@scantron.com> |
Hello, (Posting to the APIs list because this seems to be API specific) I am using GM 1.2.6 on Windows through the Magic++ API. In several instances I have to construct an Image object from my own internal buffers. I setup the type, colorspace, etc. without issue and populate the pixel (and possibly colormap) data. The problem comes down to the internal flags for the image type. Specifically when I create a grayscale image the "is_grayscale" member never gets set to True which causes problems for some of the imaging functions and encoders. Since is_grayscale is not true for instance the JPEG encoder writes out a three channel JPEG file instead of a single channel file. This is much more computationally and file size expensive than it should be. There appears to be a method internally (IsGrayImage) that is called some a few functions that sets the is_grayscale member properly however I have not found any way to have this function execute via the Magic++ interface. I believe that the is_monochrome member suffers from the same problem. Is there a way to directly or indirectly get the internal image characteristics initialized properly after creating a new image with the Magic++ interface? While I am here I might also ask if there is a recommended combination (most efficient) form of grayscale storage for GM? I ask since they can be DirectColor or PseudoColor, and even GrayscaleType and RGBColorspace. Thanks for your time, Jon O ------------------------------------------------------------------------------ _______________________________________________ Graphicsmagick-apis mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/graphicsmagick-apis