**Which formula is used in yuvtools to
convert between RGB and YUV?**
There are many variations of formula to convert between YUV and RGB. We support
two types of conversion:

* ITU-R 601 for SDTV:

RGB to YUV Conversion:

Y = (0.257 * R) + (0.504 * G) + (0.098 * B)
+ 16

U = -(0.148 * R) - (0.291 * G) + (0.439 *
B) + 128

V = (0.439 * R) - (0.368 * G) - (0.071 * B)
+ 128

YUV to RGB Conversion:

B = 1.164(Y - 16) + 2.018(U - 128)

G = 1.164(Y - 16) - 0.813(V - 128) -
0.391(U - 128)

R = 1.164(Y - 16) + 1.596(V - 128)

* ITU-R 709 for HDTV:

RGB to YUV Conversion:

Y = (0.183 * R) + (0.614 * G) + (0.062 * B)
+ 16

U = -(0.101 * R) - (0.338 * G) + (0.439 *
B) + 128

V = (0.439 * R) - (0.399 * G) - (0.040 * B)
+ 128

YUV to RGB Conversion:

B = 1.164(Y - 16) + 1.793(U - 128)

G = 1.164(Y - 16) - 0.534(V - 128) -
0.213(U - 128)

R = 1.164(Y - 16) + 2.115(V - 128)