letmaik / rawpy

📷 RAW image processing for Python, a wrapper for libraw
https://pypi.python.org/pypi/rawpy
MIT License
587 stars 67 forks source link

Add more ColorSpace enums #138

Closed kmilos closed 1 year ago

kmilos commented 3 years ago

ACES has been around for a while, but DCI-P3 (D65) and Rec. 2020 are only in LibRaw master

letmaik commented 3 years ago

Thanks, let's merge this once we bump to the next LibRaw release.

kmilos commented 3 years ago

Yep, that was the idea (hence the draft status). Also a chance to change the proposed labels...

kmilos commented 1 year ago

@letmaik Merge into prerelease branch now it is tracking LibRaw 0.21 beta?

letmaik commented 1 year ago

@letmaik Merge into prerelease branch now it is tracking LibRaw 0.21 beta?

I'd prefer not to deviate prerelease from main except for the libraw version, because otherwise code has to be merged twice and it's overall more effort.

You can easily work around this by defining your own type, since rawpy internally just calls .value() to get the integer:

from enum import Enum
import rawpy

class ColorSpace(Enum):
    """
    Color spaces.
    """
    raw=0
    sRGB=1
    Adobe=2
    Wide=3
    ProPhoto=4
    XYZ=5
    ACES=6
    P3D65=7
    Rec2020=8

raw = rawpy.imread(..)
raw.postprocess(output_color=ColorSpace.ACES)
kmilos commented 1 year ago

Ok, we can just wait a bit longer...

kamikaze commented 1 year ago

v0.21.1 is stable already: https://www.libraw.org/download#changelog