Color Space Transform

This sample source code illustrates the use of the transformation between different image color spaces. The sample code is based on Microsoft Visual Basic. The Ilixis Developer's Corner does not warrant that the sample source code. This sample source code is for guidance and illustration purposes only.



' CMY values used are between 0 and 1
' RGB values used are between 0 and 255
' All variables used are of data type DOUBLE


RGB to CMY

C = 1 - ( R / 255 )
M = 1 - ( G / 255 )
Y = 1 - ( B / 255 )


CMY to RGB

R = ( 1 - C ) * 255
G = ( 1 - M ) * 255
B = ( 1 - Y ) * 255




 


  Developer's Corner
 
Introduction
Imaging Toolkits
TWAIN
Image Formats
Color Spaces
Auto Recognition
Useful Links
Transform Logic
RGB <-> CMY
CMY <-> CMYK
RGB <-> HSL
Learn More...
Concepts