Replicating Photoshop's filters and adjustments in code
Posted: 2017-01-11T14:54:54-07:00
Ok, I realize this is a really broad topic, but I thought: why not? This is not StackOverflow where broad topics or topics asking for links are closed.
Do you know of a resource with descriptions of how to implement the various Photoshop filters and adjustments? Or just plain has implementations of them?
E.g. Chrome filter; Black and White adjustment.
I'm not asking for the blend modes because descriptions and implementations of those are easily found on the web.
There's pieces of info here and there, e.g. see:
But it's too little, too scattered and often wrong.
Even if it's not a single resource, I'd appreciate links to sites that explain that stuff for even just one or several Photoshop filters/adjs.
And just to bring something to the table myself:
The PS "Photo filter" adjustment is implemented like this (pseudocode):
... where, of course, blend(BLEND_LUMINANCE...) is implemented with the HCL colorspace as implemented in ImageMagick.
Do you know of a resource with descriptions of how to implement the various Photoshop filters and adjustments? Or just plain has implementations of them?
E.g. Chrome filter; Black and White adjustment.
I'm not asking for the blend modes because descriptions and implementations of those are easily found on the web.
There's pieces of info here and there, e.g. see:
But it's too little, too scattered and often wrong.
Even if it's not a single resource, I'd appreciate links to sites that explain that stuff for even just one or several Photoshop filters/adjs.
And just to bring something to the table myself:
The PS "Photo filter" adjustment is implemented like this (pseudocode):
Code: Select all
Image photoFilter(Image src, RGB tint, bool preserveLuminance) {
Image muld = blend(BLEND_MULTIPLY, src, tint);
if(preserveLuminance) {
return blend(BLEND_LUMINANCE, muld, src);
} else {
return muld;
}
}