Mobile app version of vmapp.org
Login or Join
Turnbaugh909

: Photoshop: Mask of variable threshold value I have an idea which I don't know how to realize using Photoshop. I'm a newbie to computer graphics and so what I want to do may sound bizarre.

@Turnbaugh909

Posted in: #AdobePhotoshop

I have an idea which I don't know how to realize using Photoshop. I'm a newbie to computer graphics and so what I want to do may sound bizarre. I haven't found any useful answer even after browsing the Internet for months.

PROBLEM: I have color photos of documents (black text on white background) taken in poor conditions (lighting etc.). I want to convert them to black and white. However, simply using the Threshold option won't do because some areas are too light while some other are too dark — in both cases, the text is invisible after applying Threshold.

MY SOLUTION: If there were a possibility to apply different Threshold value to different parts of the image, you could make all text visible after conversion to black and white. Of course, one can slice the image into many layers but this is cumbersome and tedious. Instead, I'm thinking of creating a layer, which would drive the Threshold algorithm in the following way: the darker a pixel on that layer, the higher the Threshold value for that particular pixel (applied to the Background layer of course). Somewhat like a mask…

Anyone has any idea how to do that in Photoshop CS6?

Thank you.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Turnbaugh909

2 Comments

Sorted by latest first Latest Oldest Best

 

@Holmes874

This receipe is valid if there's no disturbing unsharpness, exessive noise nor steep borders in the light conditions. This is our fake badly photographed text:



There's bad overexposure and bad underexposure. No single treshold would be good.

Make a copy of the image in another layer and blur it with Gaussian Blur filter to make single characters unrecognizable, but the light variations are still apparent:



Give to the blurred layer blending mode = difference. This nearly zeroes those areas that have smoothly changing brightness, but the characters (and the noise + steep borders in light or color will stay)



Duplicate both layers to be able to make readjustments, if needed. Merge the copies and threshold the merged layer with the curves tool:



If you have yellow or blue areas or both due simultaneous daylight and lamp light, desaturating the image can help. Before it you can turn for example the blue to yellow with Image > Adjustments > Hue/Saturation. All controls of its dialog are essential, so learn them before trying.

Noise can be fought with noise removal software. Photoshop have several tools for it. You can


open as Camera Raw, use CRW's denoising controls
use the Smart Blur filter
use the Reduce Noise filter


Special noise removal software, such as Neat Image have more possiblities.

Worry-free people use small sensor cameras in low-light conditions, photograph as JPG, avoid the camera stand and sometimes overexpose some parts to full white. Camera shaking, full white, full black and JPG compression artefacts very effectively turn this job to hopeless. If they even had RAW photos, the chances would have been much better.

10% popularity Vote Up Vote Down


 

@Sent7350415

It may be easier to lighten the darker parts of the image, then apply the Threshold afterwards.

Add an adjustment layer of type "levels": Layer -> New Adjustment Layer -> Levels

(Alternately, use a "curves" layer. This will give you better control over the results, but is confusing if you're not used to it.)

Adjust the levels until the darkest parts of the image look similar to what the lightest parts originally looked like.

Add a mask to the adjustment layer. Color the light parts of the image in the mask. Once it looks right, merge everything, then convert to black and white.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme