Live data from Hacker News

Compressing and enhancing hand-written notes (2016)

mzucker.github.io

31–40 of 78 posts

Re: Compressing and enhancing hand-written notes (2016)

#31
post #18

A simpler way of achieving the same thing is to duplicate the layer, blur the top layer heavily, and then set it to "divide".

Really? Do you care to explain? What is the dividend and what is the divisor? Why can dividing a image by its low pass filtered version (or vice versa) be used to "clean up" the image, i.e. subtract the background, find main colors and cluster similar colors with k-means? What if the divisor has pixels near zero?

[deleted]

Re: Compressing and enhancing hand-written notes (2016)

#32
post #17

I have an observation about scanning documents that results in good quality and smaller files, but I can't satisfactorily explain why it works. Consider these two cases: (1) Scan document at very high resolution as a JPG and then use a third-party program (like Photoshop or whatever) to re-encode the JPG at your preferred low resolution. (2) Scan document at your preferred low resolution as a JPG straight away. Don't…

In addition to some other points, the downscaling step in #1 may also smooth out some noise in the source image. Less noise yields more compressible data.

In my own scanning workflow, I scan at 600 or 1200dpi to png, deskew, downscale, and apply a black/white threshold. This is all done with imagemagick: mogrify -deskew 40% -scale 25% -threshold 50%

If I want a PDF after that I'll use img2pdf.

Re: Compressing and enhancing hand-written notes (2016)

#33
I used to use a free software "ComicEnhancerPro" (The author is Chinese, there is English version but may not easy to find reliable download site) specially designed to enhance scanned comics.

You can remove the background very effectively by dragging a curve with preview.

You almost always need to preview and adjust some parameters, unless you have a template for similar cases.

Re: Compressing and enhancing hand-written notes (2016)

#34
post #18

A simpler way of achieving the same thing is to duplicate the layer, blur the top layer heavily, and then set it to "divide".

Really? Do you care to explain? What is the dividend and what is the divisor? Why can dividing a image by its low pass filtered version (or vice versa) be used to "clean up" the image, i.e. subtract the background, find main colors and cluster similar colors with k-means? What if the divisor has pixels near zero?

Areas of low contrast become whiter and areas of high contrast become more saturated.

It is also more robust than k-means. The author's algo will only work on scanned images. Photographed pages from a book will often have a slight shadow on half the page from the curvature. Blur-divide will clean this up. K-means will think you've used a lot of gray and not figure out that there are multiple background colors.

Re: Compressing and enhancing hand-written notes (2016)

#35

Great job with that. I've only just started taking notes by hand once again, after being keyboard-only for many years. In your scenario, since you have assigned "scribes" taking the notes, you might be able to streamline the process with a "smart pen." There are several on the market. The one I got as a hand-me-down from a family member lets you write dozens of pages of notes, then Bluetooth them to a smartphone app…

I have found that my Galaxy Note 2014 is pretty much hands-down the best note taking tablet in my opinion. It's better than the crap that Microsoft and Apple are trying to hawk off. It doesn't have as many fancy apps but for _strictly_ note taking, sharing notes via email, and book reading, it's pretty awesome.

I just wish its price would come down. It's still full price from four years ago :| and even getting more expensive because it's so old

Re: Compressing and enhancing hand-written notes (2016)

#36
post #17

I have an observation about scanning documents that results in good quality and smaller files, but I can't satisfactorily explain why it works. Consider these two cases: (1) Scan document at very high resolution as a JPG and then use a third-party program (like Photoshop or whatever) to re-encode the JPG at your preferred low resolution. (2) Scan document at your preferred low resolution as a JPG straight away. Don't…

While the JPEG encoder in Photoshop is likely a lot better than what's in your scanner, I am, similarly to others here, fairly convinced that the majority of the difference is in the sample rate by the scanner.

I did some vanilla JS that simulates scaling from high DPI vs sampling directly at a specific DPI and the result does resemble the result of a low resolution scan.

http://chrisbenjaminsen.com/shared/samplerate/

I am aware optics does not work exactly work like this, but it's a reasonable approximation.

Re: Compressing and enhancing hand-written notes (2016)

#37
On the top image, I see that the back side of the page has clearly leaked through. In my experiences with scanning paper, I found a trick that essentially eliminates any visible backside content: Using a flatbed scanner, I would scan with the lid open, and the room darkened.

The worst thing to do is to scan with the lid closed, with a lid that has a white background. This would increase the reflection from the backside of the page.

Re: Compressing and enhancing hand-written notes (2016)

#38
post #3

Nice to see a bit of k-means clustering. I was worried that this might attempt to be "smart" by converting to symbols, replicating the "Xerox changes numbers in copied documents" bug, but it's pure pixel image processing. Very clean results. In some ways it's a smarter version of the "posterize" feature.

[deleted]

Re: Compressing and enhancing hand-written notes (2016)

#39

Great job with that. I've only just started taking notes by hand once again, after being keyboard-only for many years. In your scenario, since you have assigned "scribes" taking the notes, you might be able to streamline the process with a "smart pen." There are several on the market. The one I got as a hand-me-down from a family member lets you write dozens of pages of notes, then Bluetooth them to a smartphone app…

I have found that my Galaxy Note 2014 is pretty much hands-down the best note taking tablet in my opinion. It's better than the crap that Microsoft and Apple are trying to hawk off. It doesn't have as many fancy apps but for _strictly_ note taking, sharing notes via email, and book reading, it's pretty awesome. I just wish its price would come down. It's still full price from four years ago :| and even getting more e…

You are referring to the 10.1 tablet? I know its not the same but I had a Note4 and was pleased with its note taking ability. I imagine that with the extra screen real-estate the tablet was even better. It looks like they are $453 on Newegg! I agree that does seem crazy for an old device. If you can put up with a used device there are two on swappa for around $200 https://swappa.com/buy/samsung-galaxy-note-101-2014-wifi If it truly is the hands-down best note taking tablet you might as well buy them both and standardize to the platform.

Re: Compressing and enhancing hand-written notes (2016)

#40

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 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 o…

You can get the higher resolution one here: 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/g...

Post reply on HN