首页 > 其他 > 详细

Why the YCbCr to RGB formula

时间:2015-07-24 17:55:01      阅读:251      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!