Thursday, November 19, 2009

One last thought on Wavelet image sharpening

The GIMP's plugin documentation for the Wavelet sharpen plugin is interesting:

"The wavelet decomposition of an image results in multiple images with different frequency content. When amplifying the high frequency parts the recomposed image appears to be sharper than the original one. That way the frequency which should be amplified most can also be selected and a given unsharpness in the original image can be taken into account."

That matches with Tom Crimi's description of Wavelets as vaguely similar to the uniquitous FFT.

Wednesday, November 18, 2009

Sharpening photos like they do in CSI

There's a recurring joke on nerd hang-outs like reddit about the "enhanced photo" plot device on dramas like CSI: a grainy, low-resolution image is zoomed and sharpened to bring out impossibly small details -- finding the reflection of the killer in a distant chrome hub-cap, that sort of thing. It's obviously stupid.

But after playing around with The GIMP's "Wavelet enhance" filter, I'm really impressed -- it really seems to bring out fuzzy details:




(My best effort at cleaning the image up with contrast & brightness on the left; the wavlet-enhanced version on the right.) Clearly, it can't restore missing detail, but it seems to do a good job of improving the contrast around edges / features.

Monday, November 16, 2009

Firefox can't print, and what to do about it.

Say you've got a big, information-rich, scroll-heavy page, with annotations and doodads located a long scroll off the screen. But say it works: you can scroll around and find what you need; it's a solid app.

Firefox won't be able to print it -- not usefully, at least, b/c Firefox will print only to the right edge of the visible page, thereby limiting you to the width of your physical screen. Creating a new paper-type, some monstrously wide fictional ur-sheet, won't help things either. So what's a boy to do?

Enter CutyCapt, a WebKit-based command-line tool that renders to PNG. (Or PDF, or whatever file format your heart desires.) Better still, it will execute any Javascript on the page, so pages that are essentially blank until the JS runs will render just file.

You'll need Xvfb, the X virtual framebuffer, if you want to run it on a headless box, but Xvfb is a little miracle in itself.