MATAB use makecform and applycform functions to perform this color model conversion
Ref: makecform: https://www.mathworks.com/help/images/ref/makecform.html
Ref: applycform: https://www.mathworks.com/help/images/ref/applycform.html
RGB to CMYK:
I_rgb = imread('lena_color.jpg'); %Read the color image
C = makecform('srgb2cmyk'); %srgb (standard rgb) to cmyk
I_CMYK= applycform(I_rgb,C);
TO SAVE IN CMYK Format
imwrite(I_CMYK, 'test.tiff');
USE IMFINFO to confirm the conversion
imfinfo('test.tiff')
the command gives the output
...
Width: 512
Height: 512
BitDepth: 32
ColorType: 'CMYK'
...
CMYK to RGB:
I_CMYK = imread('lena_color.jpg'); %Read the color image
C = makecform('cmyk2srgb'); %srgb (standard rgb) to cmyk
I_rgb= applycform(I_CMYK, C);
Thanks for shearing very nice and exceptional idea about this IMAGE PROCESSING . I hope you will share about Image Processing , Photo Production , Image Retouching Service related post .
ReplyDelete