Dissecting the Photoshop "stamp" filter
July 10, 2009 9:34 AM   Subscribe

I'd like to programmatically recreate the Photoshop stamp filter - does anyone know how to dissect what the stamp filter is doing?

The Photoshop settings I'm using with the Stamp filter are: Light/Dark Balance set to 25 and Smoothness set to 5. I'd like to be able to recreate this effect without using Photoshop, but I'm not really sure what's going on under the hood. Any thoughts or pointers would be much appreciated. Thanks!!
posted by BugsPotter to Computers & Internet (4 answers total)
 
You can get a rough approximation of it by doing a blur, adjusting the brightness and contrast of the image, then running Image > Adjustments > Posterize.

The smoothness is pretty analogous to adding a blur on the image before doing the other processing, but if you throw smoothness all the way up, you can get grays in your output, which posterize wouldn't do.
posted by beerbajay at 10:45 AM on July 10, 2009


You have made me want to use the word "programatically" on my resume.
posted by ThatRandomGuy at 11:53 AM on July 10, 2009


And "posterize" seems to be a simple color quantization step (with the number of colors being very small). So using netpbm, for example, it'd be something like pnmsmooth (or better, pnmconvol with pamgauss) followed by pnmremap or pamthreshold. There might be toolkits that are easier for you to use than netpbm, but these are elementary operations most image toolkits will have.

Every time I use "programmatically" I think, "That word does not really mean what I am trying to use it to mean". But I can't think of a better word.
posted by hattifattener at 12:53 PM on July 10, 2009


A stamp filter for the gimp. Since it is open source, you can read the source and know exactly what it is doing.

In the .zip file at the top of the page, the source code is in the file ev_iccii_photoeffects_246.scm, with the code for the stamp filter starting on line 972.

Basically all you need to know to analyze this code is that (let ... ...) establishes local variables that leave scope with the last matching close parentheses, and every open parenthesis is immediately followed by a function or operator, has a return value, and everything until the matching close parenthesis is a list of arguments.

Basically, for a high level overview, after creating some temporary layers and sanity checking on input parameters, it feathers the image, then sharpens, then does a color fill. Finally it cleans up those temporary layers and anchors and such.
posted by idiopath at 1:09 PM on July 10, 2009


« Older What is the deal with the new ...   |  Why are some foods tasting lik... Newer »
This thread is closed to new comments.