3 ms·
They are not identical. If this [1] is the actual code it looks like it's operating in RGB color space. Which explains why it extracts the lowest value color
by mxfh 13y ago
They are not identical.
If this [1] is the actual code it looks like it's operating in RGB color space.
Which explains why it extracts the lowest value color component as alpha from every pixel and not just from those with low saturation.
alpha1 = (1 - a1) / (c1);
This is done three times, for each RGB channel once.
c is the selected color (in this case white with c1, c2, c3 = 1)
a are the channels of the current pixel (a1, a2, a3)
Later the highest alpha (lowest transparency) is kept for the output.
Which results in the effect that all highlights, regardless of their saturation, are made transparent.
Meanwhile the core function of KillWhite is executed in HSV color space:
Alpha = 1 - (Value - Saturation)
Here Saturation reduces transparency!
This is not the case in color to alpha.
[1] https://git.gnome.org/browse/gimp/tree/plug-ins/common/colortoalpha.c?id=bcd98991017f85aff90aee36451970d59edcb95d https://git.gnome.org/browse/gimp/tree/plug-ins/common/color...
[2] http://stackoverflow.com/a/14915403/731179 http://stackoverflow.com/a/14915403/731179
if there is need for further discussion I would suggest switching to stackexchange.
Adding to
http://superuser.com/questions/348167/how-can-i-remove-all-white-parts-from-an-image-in-photoshop http://superuser.com/questions/348167/how-can-i-remove-all-w...
or
http://graphicdesign.stackexchange.com/questions/13073/alpha-transparency-remove-background-photoshop http://graphicdesign.stackexchange.com/questions/13073/alpha...
or open something new