Various utility functions for performing color conversions/transformations/etc.
colortransforms.q | Various utility functions for performing color conversions/transformations/etc. |
Functions | |
is_rgb | Returns true only if the image is an RGB image |
is_gray | Returns true only if the image is a grayscale image |
color_cov | Computes the color band covariance matrix of an image |
PCA_color_transform | Computes the color decorrelating transform using Principal Component Analysis (PCA) in the L2 sense |
L1PCA_color_transform | Computes the color decorrelating transform using Principal Component Analysis (PCA) in the L1 sense |
get_colortransform_from_RGB | |
colortransform | Apply the specified color transform to an image |
rgb2gray | Conversion from RGB to grayscale |
gray2rgb | Conversion from grayscale to RGB |
compute_hue | Computes the HUE value of a given RGB color value |
rgb2hsv_devicefunc | Conversion from RGB to Hue-Saturation-Value (HSV) |
rgb2hsv_devicefunc | Conversion from RGB to Hue-Saturation-Luminance (HSL) |
rgb2hsv | Conversion from RGB to Hue-Saturation-Value (HSV) |
rgb2hsl | Conversion from RGB to Hue-Saturation-Luminance (HSL) |
rgb2hsv_devicefunc | Conversion from Hue-Saturation-Value (HSV) to RGB |
hsv2rgb | Conversion from Hue-Saturation-Value (HSV) to RGB |
hsl2rgb_devicefunc | Conversion from Hue-Saturation-Lightness (HSL) to RGB |
hsl2rgb | Conversion from Hue-Saturation-Lightness (HSL) to RGB |
rgb2lab | Conversion from RGB to the CIELAB color space |
hsl_correct | Performs Hue-Saturation-Lightness correction of an image |
Get the specified color transform [Note | only a couple of linear color transforms are supported here] |
[U, Ut] = get_colortransform_from_RGB(colorspace, img = 0)
colorspace | supported color spaces are “RGB”, “PCA”, “YCbCr”, “YUV” |
img | the input image (in case of “PCA”) |
U | The forward color transform |
Uinv | The inverse color transform |
Performs Hue-Saturation-Lightness correction of an image
function [] = hsl_correct(img_in, img_out, add_hue, add_saturation, add_lightness)
img_in | input image |
img_out | output image |
add_hue | the amount of hue to add (hue values are in the range [0,1]) |
add_saturation | the amount of saturation to add |
add_lightness | the amount of lightness to add |
the values of add_hue, add_saturation, add_lightness can also be negative.