SRGB-aware image resize in Pillow

后端 未结 3 1814
庸人自扰
庸人自扰 2021-02-15 14:06

Pillow\'s basic Image.resize function doesn\'t appear to have any options for SRGB-aware filtering. Is there a way to do SRGB-aware resizing in Pillow?

I could do it ma

3条回答
  •  滥情空心
    2021-02-15 14:45

    99% of image resize implementations will not get sRGB right (which, unfortunately, is 99.9% of image material), and those who do usually will do it right by default and give you the option to opt out of gamma de/encoding.

    [opinionated mode on, read with care]

    IOW, if there is no option you likely have to add the code yourself - or just use pamscale. If a library doesn't get sRGB right it will have other flaws anyway.

    [opinionated mode off]

    You could de/encode yourself as discussed in

    http://www.imagemagick.org/discourse-server/viewtopic.php?t=15955

    but a from quick glance it seems pillow is not capable of doing that trick.

提交回复
热议问题