码迷,mamicode.com
首页 > 其他好文 > 详细

Why the YCbCr to RGB formula

时间:2015-07-24 17:56:05      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

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.imagemagick.org/discourse-server/viewtopic.php?t=23404
 

Why the YCbCr to RGB formula

标签:

原文地址:http://www.cnblogs.com/artestlove/p/4674031.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!