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

Document color space of rendered output #629

Closed
e00E opened this issue May 25, 2023 · 3 comments
Closed

Document color space of rendered output #629

e00E opened this issue May 25, 2023 · 3 comments

Comments

@e00E
Copy link
Contributor

e00E commented May 25, 2023

The resvg documentation does not mention the color space of the rendered output. The type that render works with is PixMap, which is documented like this:

A container that owns premultiplied RGBA pixels.

This doesn't tell me what the color space is. SVG works in sRGB color space. A manual test shows that resvg stays in sRGB. This wasn't obvious to me. Could it be documented explicitly?

@RazrFalcon
Copy link
Collaborator

Technically there are no color space. But we assume it is sRGB.

@e00E
Copy link
Contributor Author

e00E commented May 25, 2023

This might be obvious to people who are more familiar with SVGs. I was confused when I double checked my code for color space correctness. Maybe one sentence somewhere in the resvg docs would help clear it up. The way I understand it now is that tiny-skia has no concept of color spaces and resvg follows whatever SVG does, which is always sRGB. Feel free to close the issue if you think it isn't needed.

@e00E
Copy link
Contributor Author

e00E commented May 25, 2023

You could imagine a different svg library where the final output is presented to the user in a Pixmap equivalent that is in a different color space. For example, it could be linear RGB instead of sRGB with gamma. This is why I was unsure.

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