3 ms·
I can get seemingly comparable results with a couple of simple operations in Gimp. Here is a casual job on the first image: https://i.imgur.com/Sy2rvsU.png ht
by kazinator 9y ago
I can get seemingly comparable results with a couple of simple operations in Gimp.
Here is a casual job on the first image:
https://i.imgur.com/Sy2rvsU.png https://i.imgur.com/Sy2rvsU.png
The steps:
1. Duplicate the layer.
2. Gaussian-blur the top layer with big radius, 30+.
3. Put the top layer in "Divide" mode. Now the image is level.
4. Merge the layers together into one.
5. Use Color->Curves to clean away the writing bleeding through from the opposite side of the paper.
6. To approximate the blurred look of Matt Zucker's result, apply Gaussian blur with r=0.8.
Notes:
The unblurred image before step 6 is here: https://i.imgur.com/RbWSUnD.png https://i.imgur.com/RbWSUnD.png
Here is approximately the curve used in step 5: https://i.imgur.com/lvfqCNK.png https://i.imgur.com/lvfqCNK.png
I suspect Matt worked at a higher resolution; i.e. the posted images are not the original resolution scans or snapshots.
- fouc 9y agoYou can get the higher resolution one here: https://github.com/mzucker/noteshrink/blob/master/examples/notesA1.jpg https://github.com/mzucker/noteshrink/blob/master/examples/n... BTW I'm curious how you'd fare on the graph one. I didn't like his results for it. https://github.com/mzucker/noteshrink/blob/master/examples/graph-paper-ink-only.jpg https://github.com/mzucker/noteshrink/blob/master/examples/g...
- deleted 9y ago[deleted]
- kazinator 9y agohttps://imgur.com/a/dsLhk https://imgur.com/a/dsLhk Note how the grid is completely gone, the Sharpie strokes are fuller and the ghosting around the red ink is gone. (The word "Red" seems to have been written faintly, like with a non-working ball point pen, and then written over properly.) The thing is, I took a completely different approach here. I won't give a complete step-by-step recipe, but the gist of it is this: 1. Create a copy layer of the image. 2. Optionally level the intensity with the divide trick; I didn't bother. 3. Convert this copy to grayscale. 4. Threshold it to black and white, such that the grid is eliminated, but the writing remains solid. 5. Blur the writing (radius 3-4). 6. Threshold again. 7. Now you have a black and white version that is a bit thicker than the original. TURN THIS INTO A LAYER MASK. An inverted one which passes through the writing, and renders everything else transparent. 8. Apply this mask to the original image. This requires transfering a layer mask between layers. 9. Slide a white background under the masked layer. Now you have the lettering clean on white. 10. Play with simple Color->Brightness-Contrast. I ended up with something like brightness -66, contrast +88. In the final step, because of the layer mask that is in effect, these controls affect only the writing: the white coming from the unaffected layer below stays white no matter what you do with the contrast and brightness controls. Why the different approach: I first tried the original approach and the result was good. But I thought you wouldn't like it either. It was similar to Matt's. I did a better job of eliminating the grid, but the writing was less vivid. (Likewise I also preserved the yellow tint of the paper.) I wanted the grid completely gone, with vivid writing. Playing with the intensity transfer curves was not quite doing it; there was poor separation between vanshing the grid while preserving the ink. This attempt can be seen here: https://imgur.com/a/ldrBN https://imgur.com/a/ldrBN The green writing is particularly unsatisfactory.
- remram 9y agoUsing a blurred version of the whole image as background is probably better than what the OP is doing, as I understand it he's treating the background as a single fixed color. In particular my use case is cleaning up pictures of whiteboards, where the brightness from the room is not as constant as a scan, and the approach wouldn't work at all. Probably an easy PR for that repo though?