# How to calculate the YUV values of a grayscale image ?

Is it possible to calculate the values YUV of a graycale image ?

I found an article that confuses me: Interactive Image Colorization and Recoloring based on Coupled Map Lattices In which the authors propose an algorithm to color and recolor an image.

First they color grayscale images. The user scribble some regions of the image with the desired color which spreads itself automatically by the algorithm. They use YUV color space to compare the values of Y between the current pixel and its neighbors. If the Y value of a neighbor is stronger than the current pixel sets its U and V values to those of the neighbor (attacker).

My problem: how can I cancluate the YUV values of a given pixel of a grayscale image ?

edit retag close merge delete

Sort by ยป oldest newest most voted

An YUV image is composed of three channels: luminance/luma (Y/Y'), chroma blue (U), chroma red (V).

If your image is in YUV space and appears grayscale, it has no blue and red components, only luminance, zero blue and red components. Or if your image is in RGB space and grayscale, its R, G and B values are not too diverse, e.g. (R,G,B) = (120,115,123).

Conversion is done by:

more

is the Y of the a grayscale image the same one as in an image of YUV color space ?

( 2015-03-10 12:26:07 -0500 )edit

Yes it is.

( 2015-03-10 12:30:33 -0500 )edit

thank you very much

( 2015-03-10 12:32:53 -0500 )edit

You are welcome.

( 2015-03-10 13:47:16 -0500 )edit

Official site

GitHub

Wiki

Documentation