Subtractive color/colour mixing (yellow+blue=green)

Asked by Christoph Ra on 2017-01-09

It's a common feature of graphic software that a blend between two colours doesn't take into account the "gamma" used for storing these colors. As a result, overlaying two partially transparent blues and yellows doesn't produce green, but a darker shade of brown. This is also the case in Inkscape. Is there a way in Inkscape to do it correctly? Neither of the new layer blend modes (awesome as they are) in 0.92 does this.

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
Christoph Ra
Solved:
2017-01-10
Last query:
2017-01-10
Last reply:
2017-01-10

This question was reopened

Christoph Ra (chraab) said : #2

Hey Aman J, you made a mistake there. (Assuming you didn't mean to mash your keyboard and close a question.)

Bryce Harrington (bryce) said : #3

anm123 appears to have been a spam account.

Hachmann (marenhachmann) said : #4

Hi Christoph,

while I'm quite sure it should be possible to achieve this with filtering, I've got no idea how to go about this.

At inkscapeforum.com, there are a couple of users who are deeply invested into working with filters, I bet they'll be able to answer this (with a filter).

Regards,
 Maren

Bryce Harrington (bryce) said : #6

another spam closure

su_v (suv-lp) said : #7

Example documented here:
http://tavmjong.free.fr/SVG/COLOR_INTERPOLATION/index.html

Open the file embedded on that page [ http://tavmjong.free.fr/SVG/COLOR_INTERPOLATION/blending_colorspace.svg ] in a recent Inkscape version (>= 0.91) ...

Christoph Ra (chraab) said : #8

Thank you su_v! This seems to be indeed the solution, though it might take me a while to figure out how to reproduce this for my purpose, a linear gradient...

su_v (suv-lp) said : #9

@Christoph - please share any results if you manage to achieve this magic via filter effects ;-)

[ Inkscape like all major web browsers only supports interpolation in sRGB for gradients, Batik OTOH supports both sRGB and linearRGB: http://tavmjong.free.fr/blog/?p=765 ]

In case the focus is on color interpolation in linearRGB more than on actual gradient paint servers:
I could offer modified versions of Inkscape's Interpolate extensions (which can interpolate colors in object styles in sRGB, linearRGB, HSV; Cie Lab/Luv, LCH), as showcased in this (older) screencast:
 https://dl.dropboxusercontent.com/u/65084033/irc/Screen%20Recording%2016.mp4

The extensions are part of a larger set maintained here:
https://gitlab.com/su-v/inx-modifycolor/
Available downloads:
https://gitlab.com/su-v/inx-modifycolor/tags