Problems with using a rough greyscale algorithm?

前端 未结 7 2091
生来不讨喜
生来不讨喜 2021-02-06 20:43

So I\'m designing a few programs for editing photos in python using PIL and one of them was converting an image to greyscale (I\'m avoiding the use of

7条回答
  •  伪装坚强ぢ
    2021-02-06 20:45

    The most obvious example:

    1. Original

    2. Desaturated in Gimp (Lightness mode - this is what your algorithm does)

    3. Desaturated in Gimp (Luminosity mode - this is what our eyes do)

    So, don't average RGB. Averaging RGB is simply wrong!

    (Okay, you're right, averaging might be valid in some obscure applications, even though it has no physical or physiological meaning when RGB values are treated as color. By the way, the "regular" way of doing weighted averaging is also incorrect in a more subtle way because of gamma. sRGB should be first linearized and then the final result converted back to sRGB (which would be equivalent of retrieving the L component in the Lab color space))

提交回复
热议问题