Handling CMYK Files as Separate Bitmaps

LEADTOOLS supports loading TIFF or JPEG CMYK files without converting the data to BGR. This is done by loading each CMYK plane as a separate LEADTOOLS bitmap using L_LoadFileCMYKArray. Alpha channel information can be loaded or ignored as follows:

or :

If the source file is not in the TIFF or JPEG CMYK format, load the bitmap normally with L_LoadBitmap, L_LoadBitmapMemory, L_LoadBitmapResize, L_LoadFile, L_LoadFileOffset, or L_LoadMemory and then obtain the CMYK planes by calling L_ColorSeparateBitmap.

Paint the bitmaps using L_PaintDCCMYKArray.

To save the bitmap as TIFF or JPEG CMYK, call L_SaveFileCMYKArray. To save as another format, create a BGR bitmap using L_ColorMergeBitmap or L_ClrConvertCMYKArray and then save the image with L_SaveBitmap or L_SaveFile.

Conversion of CMYK to BGR

LEADTOOLS provides two methods to convert the CMYK input data to BGR:

Automatic Conversion

When loading a CMYK file by calling one of the load functions (L_LoadBitmap, L_LoadFile, etc.), the conversion will be performed automatically using CMYK profile if:

Custom Conversion

The conversion can be performed using custom CMYK ICC profile in the following manner:

  1. Load the input file as CMYK planes by calling L_LoadFileCMYKArray function.
  2. Create a CMYK->BGR color conversion handle that uses custom ICC profile by calling L_ClrInit function.
  3. Convert the CMYK planes to BGR by passing the color conversion handle to L_ClrConvertCMYKArray function. The example in the function shows how to apply the conversion.

NOTE

The bitmap can be manipulated by manipulating each plane independently. Some transformations should be performed to all planes, while others should be performed to a particular plane. Examples:
* Spatial transformation like flip, resize, rotate, etc. should be performed on all planes. Otherwise, unexpected results may occur.
* Other transformations should be done to a particular plane. For example:
K plane controls the amount of black ink. Changing the intensity of the K plane will darken or lighten the bitmap.
Changing the brightness of one of the other planes will change the color rather than the image brightness.

To have a better understanding of what is needed to achieve a particular result, this requires studying how the CMYK planes are combined to make the final image.

Help Version 23.0.2024.10.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.