标签:
The algorithm used by PIL v1.1.7 gives me ‘washed out‘ looking results. When I convert the same source data using ffmpeg it looks normal. Using mplayer gives identical results to ffmpeg (probably they use the same library underneath). This leads me to believe PIL may be stuffing up their colour space conversions. The conversion seems to be sourced in libImaging/ConvertYCbCr.c
:
/* JPEG/JFIF YCbCr conversions
Y = R * 0.29900 + G * 0.58700 + B * 0.11400
Cb = R * -0.16874 + G * -0.33126 + B * 0.50000 + 128
Cr = R * 0.50000 + G * -0.41869 + B * -0.08131 + 128
R = Y + + (Cr - 128) * 1.40200
G = Y + (Cb - 128) * -0.34414 + (Cr - 128) * -0.71414
B = Y + (Cb - 128) * 1.77200
*/
http://stackoverflow.com/questions/7041172/pils-colour-space-conversion-ycbcr-rgb?rq=1
And back: https://en.wikipedia.org/wiki/YCbCr#JPEG_conversion
标签:
原文地址:http://www.cnblogs.com/artestlove/p/4674031.html