Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linear color space support #12

Open
RazrFalcon opened this issue Nov 7, 2020 · 8 comments
Open

Add linear color space support #12

RazrFalcon opened this issue Nov 7, 2020 · 8 comments

Comments

@RazrFalcon
Copy link
Collaborator

No description provided.

@virtualritz
Copy link

It would be great if this included support for out-of-gamut color values. I.e. values > 1.0 (HDR) and < 0.0 (for certain blending effects).
At least for the cases where all data is f32 or f16 this merely is avoiding any clamping anywhere in the pipeline (could be hidden behind a hdr feature gate).

@RazrFalcon
Copy link
Collaborator Author

Does this supported by Skia? Because tiny-skia is and will be just a Skia fork.

@virtualritz
Copy link

virtualritz commented Dec 15, 2020

It is not only supported, it's the default behavior. I just tried via safe-skia. f32 channel Pixmap written out as an OpenEXR and using out-of-gamut Color4fs on a gradient. All values are ending up in the EXR unclamped.

I can send you can example, if you like.

@RazrFalcon
Copy link
Collaborator Author

This would be great, because I'm not sure about what feature are you talking. And Color in tiny-skia (aka Color4f) is always clamped.

@virtualritz
Copy link

virtualritz commented Dec 15, 2020

Check out my port of the icon example from skia-safe.
Modified to use linear color and writing out an OpenEXR of a single image to check in a third party app. I attached a screenshot from 3Delight Display which has a sampler tool. You can see the value from the code below (R10.0, G5.0, B2.0, A1.0) is retained in the outline's color.

In the image below I set PEN_SIZE to 4.0 and replaced line 263 in render.rs with

sk::Color4f::new(10.0, 5.0, 2.0, 1.0),

Screen Shot 2020-12-15 at 12 28 39

P.S.: I also have an issue open at skia-safe regarding reading that Color4f data in a way that alleviates use of unsafe.

@RazrFalcon
Copy link
Collaborator Author

Thanks.

@virtualritz
Copy link

@termhn’s latest works, cint and colstodian, make the outfacing API part of this a bit more straightforward, I guess.

@RazrFalcon
Copy link
Collaborator Author

The current issue is lack of time from my side. I'm not sure how those creates could help me. Skia already supports this, so I simply has to port it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants