light washes out text AND noise in photoshop not in ST

Scan Tailor specific announcements, releases, workflows, tips, etc. NO FEATURE REQUESTS IN THIS FORUM, please.

Moderator: peterZ

spamsickle
Posts: 596
Joined: 06 Jun 2009, 23:57

Re: light washes out text AND noise in photoshop not in ST

Post by spamsickle »

When I say "robust", I mean a script that will provide the results you want over a diverse set of inputs. I have only done a little work with Photoshop scripts, so you probably know more about them than I do -- I would have thought the "magic wand" tool would be something you couldn't script, since (as I've used it) it requires manually drawing a rough line around the region(s) you want to select.

The problem I foresee with a scripted color selection solution is that any color which is likely to be showing through from the back of the page is also likely to be present on the front of the page. You may imagine this problem can be overcome because "the show-through color is less saturated" or some such rule, but at the level of the pixel I don't think this will be true. At the edges of every solid-colored area on the front page you'll have unsaturated pixels, because the camera is averaging a bit of the color area and a bit of the white page to produce a single set of RGB values for that pixel. If you subsequently select these edges and clip them to white, you'll be getting "jaggies" which may be as annoying as the ghosting.
o3h1p
Posts: 71
Joined: 08 Nov 2010, 22:47

Re: light washes out text AND noise in photoshop not in ST

Post by o3h1p »

The magic wand does auto selection for contiguous areas with a single click, so you don't have to do draw any lines so it's easily scriptable, the problem is that it doesn't take care of enclosed letters (for example the middle of the letter "o") would still have the darker color. (It also has other problems, like problems with gradients, so this isn't the best solution).

The color selection tool can be tweaked with a threshold to avoid the problem you are referring to. It actually works really well so there is no subtraction around the black text but the shadow is removed. It definitely does remove that particular color (or range) if it's in the page, but that occurrence is rare enough that it makes it the best solution so far. Now again, this is with the black paper behind the page. I have done a color selection and remove without the black paper but because the color isn't so uniform in the shadow, the results are not as good. In this case, I think I had more success with clipping the high end with the 'levels' tool than removing a particular color range with the color selection tool.
Anonymous2
Posts: 97
Joined: 18 Oct 2011, 16:05

Re: light washes out text AND noise in photoshop not in ST

Post by Anonymous2 »

I think the most effective solution would be with Scan Tailor, truthfully. The binarization code could be modified so that you can define a few preset colors to choose from instead of black and white, but that isn't something that I am completely familiar with. I've coded posterization with Python before, but ST is a beast to work with. I'll try asking on the Dev mailing list.
o3h1p
Posts: 71
Joined: 08 Nov 2010, 22:47

Re: light washes out text AND noise in photoshop not in ST

Post by o3h1p »

Actually ST does a fantastic job in 'mixed' mode at removing the shadows but it does have two limitations which make it not the best solution:

* Doesn't pick up color text (maybe this is what you referring to)
* Does not always correctly identify the picture areas

I am amazed at its ability to pick up picture areas currently, it really is quite impressive, but the problem is that it fails on about 10% or so of pages. This means you have to review every page and fix 10% of them. This takes forever, so I don't really consider this a workable solution at the moment.
Post Reply