-
Notifications
You must be signed in to change notification settings - Fork 648
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
Make sure effects and other color management is being calculated in linear RGB space. #353
Comments
I can't believe there isn't a simple composite operation for "add". I'm having difficulty figuring out how the writers of the spec intended for us to be able to consume the pre-multiplied output of the path drawing operations. |
I can't think of a way for the canvas (in realtime) to get the layer alpha blending working in linear space. It can definitely be done with WebGL fairly easily, but that would be quite a significant rewrite. Specific things like the gaussian blur filter can be fixed, though, since most filters aren't realtime anyways. Maybe provide a toggle in the dialog for gaussian blur for "linear blending", but that no longer applies it as a realtime fx when selected. |
Sadly, as I understand, WebGL use different API than Canvas "2d". So it means rewriting most of miniPaint code. |
Yes, WebGL is much more complicated to set up. But it is also much more performant and gives the ability to do realtime effects with shaders. May be something to consider. |
Here's a fun fact, I found out that most CSS filters are hacks that don't do proper color space conversions that regular image editors do.
For example, css
filter: blur(5px)
. You can see a dark line in the middle where green and red are merged.Here is the same image with a gaussian filter in GIMP.
The reason behind this is most images are encoded in the sRGB color space. Working directly on pixels without converting sRGB to linear sRGB first results in mistakes like this. A typical editor workflow is:
I know the
hue-rotate
filter also has an issue where it is approximating the rotation in sRGB space instead of properly converting to HSV/HSL first, rotating, then converting back to sRGB. It may be beneficial to implement "slow, but correct" versions of these filters.The text was updated successfully, but these errors were encountered: