Log in

View Full Version : Luminosity mask for Vapoursynth?


lansing
29th December 2020, 12:27
I just came across this luminosity masking technique (https://design.tutsplus.com/tutorials/how-to-create-and-use-luminosity-masks-in-adobe-photoshop--cms-23549) recently while working on my scans in Photoshop and found it very useful. Variant masks were created for different levels of highlights and shadows, and with these we can easily apply different filters to parts of the frame base on luminosity.

So I'm requesting a plugin like this to anyone that is interested or just share your thought how to make one.

butterw2
29th December 2020, 13:43
You'd need to find the formulas used to generate the luminosity masks in Photoshop.

VoodooFX
29th December 2020, 20:28
I think you are talking about adaptive binarization, would be nice to see such algos ported to Synths, here is one paper on it Comparison of Niblack inspired Binarization Methods for Ancient Documents (https://www.researchgate.net/publication/221253803_Comparison_of_Niblack_inspired_Binarization_Methods_for_Ancient_Documents).

Wolf's algo is pretty good, paper claims that Fang and NICK is even better.

Here is paper about improving such algos with preprocess Improvement of Image Binarization Methods Using Image Preprocessing with Local Entropy Filtering (https://www.researchgate.net/publication/333635736_Improvement_of_Image_Binarization_Methods_Using_Image_Preprocessing_with_Local_Entropy_Filtering_for_Alphanumerical_Character_Recognition_Purposes)

lansing
30th December 2020, 07:08
I think you are talking about adaptive binarization, would be nice to see such algos ported to Synths, here is one paper on it Comparison of Niblack inspired Binarization Methods for Ancient Documents (https://www.researchgate.net/publication/221253803_Comparison_of_Niblack_inspired_Binarization_Methods_for_Ancient_Documents).

Wolf's algo is pretty good, paper claims that Fang and NICK is even better.

Here is paper about improving such algos with preprocess Improvement of Image Binarization Methods Using Image Preprocessing with Local Entropy Filtering (https://www.researchgate.net/publication/333635736_Improvement_of_Image_Binarization_Methods_Using_Image_Preprocessing_with_Local_Entropy_Filtering_for_Alphanumerical_Character_Recognition_Purposes)

No, that algorithm was made specifically to filter text from old text books.

quietvoid
30th December 2020, 15:27
You might have some luck with the mask from https://git.kageru.moe/kageru/adaptivegrain

Info about the algorithm: https://blog.kageru.moe/legacy/adaptivegrain.html
A pure python version is also available in the article.

poisondeathray
31st December 2020, 17:34
Those photoshop ones work in RGB, but there is an avisynth masks pack that had a lumamask function that could specify Y ranges to isolate black and white points (for the mask) with falloff (so you don't get abrupt binarized transitions) . It would have to be converted to vapoursynth-ese , but it might be a good starting point. I think the legendary didee was the original author, but dogway made some mods