ImageEn, unit imageenproc

TImageEnProc.GetCMYKChannels

TImageEnProc.GetCMYKChannels


Declaration

function GetCMYKChannels(Channel: Integer): TIEBitmap; overload;
procedure GetCMYKChannels(BitmapC, BitmapM, BitmapY, BitmapK: TIEBitmap); overload;


Description

Return a Bitmap with the CMYK specified channel. The result Bitmap is a gray level representation of the specified channel.
Or copies the CMYK channels to separate bitmaps.

Channel is the CMYK channel. You can specify one of the following constants:
Constants Channel
CMYK_C (0) Cyan
CMYK_M (1) Magenta
CMYK_Y (2) Yellow
CMYK_K (3) Black ("Key")

Note:
 If the image PixelFormat is not ie24RGB, it will be converted
 You need to free the bitmap returned by GetCMYKChannels()


Demos

Demo  Demos\ImageEditing\CompleteEditor\PhotoEn.dpr
Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr


Image Testing

// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

  

// Return the Cyan channel of the image
bmp1 := ImageEnView1.Proc.GetCMYKChannels( CMYK_C );

  

// Return the Magenta channel of the image
bmp1 := ImageEnView1.Proc.GetCMYKChannels( CMYK_M );

  

// Return the Yellow channel of the image
bmp1 := ImageEnView1.Proc.GetCMYKChannels( CMYK_Y );

  

// Return the Key (black) channel of the image
bmp1 := ImageEnView1.Proc.GetCMYKChannels( CMYK_K );

  


Example Overload 1

cc := ImageEnView1.Proc.GetCMYKChannels( CMYK_C );
mm := ImageEnView1.Proc.GetCMYKChannels( CMYK_M );
yy := ImageEnView1.Proc.GetCMYKChannels( CMYK_Y );
kk := ImageEnView1.Proc.GetCMYKChannels( CMYK_K );

ImageEnView2.IEBitmap.Assign( cc ); // Copy Cyan channel
ImageEnView3.IEBitmap.Assign( mm ); // Copy Magenta channel
ImageEnView4.IEBitmap.Assign( yy ); // Copy Yellow channel
ImageEnView5.IEBitmap.Assign( kk ); // Copy Black channel

cc.Free;
mm.Free;
yy.Free;
kk.Free;

ImageEnView2.Update();
ImageEnView3.Update();
ImageEnView4.Update();


Example Overload 2

ImageEnView1.Proc.GetCMYKChannels( ImageEnView2.IEBitmap, ImageEnView3.IEBitmap, ImageEnView4.IEBitmap, ImageEnView5.IEBitmap );
ImageEnView2.Update();
ImageEnView3.Update();
ImageEnView4.Update();
ImageEnView5.Update();