Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
Introduction: Color Conversion
Color Conversion functions enable conversion between color-spaces using different methods and options. LEADTOOLS supports the following conversions:
Source Color Space |
Can be converted to |
Conversion method |
Recommended |
RGB |
Any other color space. |
Built-in, ICC profiles, or emulation tables, depending on the destination color space. |
|
BGR |
Any other color space. |
Built-in, ICC profiles, or emulation tables, depending on the destination color conversion. |
|
YUV |
Any other color space. |
1. Built in. |
|
CMYK |
Any other color space. |
1.Emulation Tables (one way CMYK => RGB) 2.ICC Profiles. 3.Built in. |
The best conversion is through the ICC Profiles (USE_ICC), this is because of the nature of the CMYK conversion, which is machine-dependant. You can use profiles that vary in the degree of black color (ink) generation. |
HSV |
Any other color space. |
1. Built in. |
|
HLS |
Any other color space. |
1. Built in. |
|
YIQ |
Any other color space. |
1. Built in. |
|
CMY |
Any other color space. |
1.Built in. 2.ICC Profiles |
|
LAB |
Any other color space. |
1. Emulation Tables (one way CMYK => RGB). 2. ICC Profiles. 3.Built in. |
For two-way conversion, RGB to LAB and vice versa, the best solution is with emulation tables and Built in conversions, because the colors are preserved better. However for one way you can use ICC profiles. |
XYZ |
Any other color space. |
1. Built in. |
|
YCCK |
Any other color space. |
1. Built in. |
|
Y41P |
Any other color space. |
1. Built in. |
|
UYVY |
Any other color space. |
1. Built in. |
|
YUY2 |
Any other color space. |
1. Built in. |
|
YVU9 |
Any other color space. |
1. Built in. |
|
YCC |
Any other color space. |
1. Built in. |
|
LEADTOOLS uses the following methods for conversion between color conversions:
Each of the conversion methods listed above can be customized. For example, conversion between RGB to CMY with ICC color conversion profiles can be done with either the built-in profiles or with user-supplied profiles as shown in the table above.
For more information, refer to:
Initializing a Color Conversion Class Object
Color Conversion Alignment Parameters
Freeing the Color Conversion Class Object
Raster Image Functions: Color Conversion