ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

ColorSync 2.0 Gamut Checking


Q: I'm using CMCheckBitmap() API to do gamut checking in a plug-in for Photoshop. The result bitmap is not what I expected. Here's the scenario:

The source profile is a typical monitor profile, and the destination profile (for the gamut check) has the data-color space of CMY and the interchangeSpace of Lab. The gamut tag was set to have three identity-input channels, a CLUT , and one output channel, which sets everything to be inside the gamut. Since the gamut was set to be "all in gamut," the result image should be all in gamut (0). However, The result image which came from CMCheckBitmap() was not all in gamut, and the result image varies each time the gamut check is performed.

Do you have any idea what would cause this problem? Also, does the leftmost bit of byte 0 contain the gamut for the first pixel of the source image? Please elaborate on the format of the result image?

A: CMCheckBitmap sets each pixel in the result bitmap to black if the corresponding pixel in the source bitmap is out of the gamut. However, CMCheckBitmap does not set each pixel in the result bitmap to white if the pixel in the source bitmap is in the gamut. For this reason, be sure to erase the result bitmap to white before calling CMCheckBitmap. (This is also true of CheckPixMap and CheckColors.)

It could be that you are incorrectly allocating the bitmaps or misinterpreting the result bitmap. You are correct that the high-bit of byte 0 of the bitmap-image data contains the gamut for the first pixel of the source image, because the pixelSize of the result bitmap is 1.

If neither of the above are causing the problem, there may be something strange about your profile's gamut tags. To confirm this, try using the CSDemo application on the SDK to test the profile. To do this, open a PICT file, open your profile, select "Make Printer Profile" from the "Profiles" menu, check the "ColorSync" checkbox in the PICT window, and select "Gamut Check" from the "Mode" popup.

[Aug 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.