An introduction to my little scan cropping helper.

In my series of "things that annoy me by taking an unneccesary amount of time to do", we arrive today at cropping.
Now, if you just want to do half-assed cropping, it doesn't take too long. Draw a box on the zoomed out page in PS and you're pretty much done. But if you (like me) can't make yourself ignore the fact that that chops away too much, this program might possibly be for you.

"Installation"

The program comes as a single file executable. No installer. No Registry settings. No .ini file.

Here's a link to download the program zip, if you haven't already. (Current version is 0.2.0, made on 2007-03-08)

"Uninstallation"

Delete the program file.

Running it

You can start it with just:
crop
which picks up all the files the program likes, in the directory you run it from.

or:
crop filename
which crops one single file by the name specified.

or:
crop *.extension
which picks up all files with that extension

or maybe a mix:
crop *.jpg spiffy_scan_017.png crapmanga_*.tif

Input file formats are PNG, TIFF, or JPEG.
Output file formats are PNG and TIFF. (Outputting to a lossy format will never be supported.)
PSD files are actually somewhat supported as input. But it varies over different files whether it works or not, so they're not automatically picked up. Try a
crop *.psd
It may work for you (it works for the files I've made myself, but not some others).

All cropped files end up in a subdirectory called
cropped
Files by the same names as the output files, that are already in that directory, are overwritten without mercy.

Running it (simplified version)

Double click on the program.

Controlling it

To tell you the truth, I think I've set a new record for user unfriendliness this time.
The learning curve is fairly steep, but on the other hand, it's snappy to use once you're used to it. Just how I like it.

All user input is handled via the keyboard.

Keys are:
Alt-arrow keysSelect which edge to crop.
arrow keysAdjust cropping border one pixel in that direction.
Ctrl-arrow keysAdjust cropping border in that direction, in bigger steps.
Shift-arrow keysAdjust cropping border in that direction, in even bigger steps.
+ / -Zoom in/out.
*Min zoom.
/Max zoom.
SpaceGo to next file without writing anything.
BackspaceGo to previous file without writing anything.
Enter / wWrite the current file (cropped) and go to the next one.
iInvert the current image. (Useful for black pages on black background, in particular.)
a"Autolevel" the current image. (Useful for very unleveled images. Only works on greyscale, though.)
 Neither invert nor autolevel does anything to the actual image, they only affect what's displayed.
gShow guide.
cRough autocrop. (Useful when you have huge black borders, mostly.)
PageUp / PageDownIncrease/decrease size of guide.

As you can see, it's built to be used with both hands. Apologies in advance to any people cropping porn out there.


Now, the trick to this program, and in fact the only thing that justifies its existence, is that it only zooms in one direction.
Either horizontally or vertically. So no matter how much you zoom in or out, you always see the whole page in the other direction.
This makes the page look highly odd, of course. But if not for that, there would be little advantage to doing this in PS.

For instance, let's say you've selected to crop the right page edge (Alt-arrow right). If you now press +,
the display will zoom in horizontally, keeping the full height of the page visible.
You can now adjust the cropping border all you want to the left and right by use of the arrow keys in combination with Ctrl and Shift.


Well, another thing it has going for it is the guide, which is something I came up with after having used the very first version for a while.
I found myself wishing for some visual guide to help me crop the same amount on both sides, or to crop several pages to have roughly the same margin.
(I don't care about absolute pixel values here, but it's nice if they look somewhat the same.)
It's highly simple, really. Just a box drawn with its sides a certain percentage of the page width out from the sides of the output scan.
Oh, and it's only visible when zoomed out full, so as not to fool anyone into trusting it too much over their own eyes...

Hands on

I'm not sure I need any screenshots here, try the program and you should get a feel for how it works.

Words of warning

Never crop before straightening the page.
Don't use it on double pages. (Or at least not before you've merged them.)
Don't use the guide in the wrong place. Some pages aren't supposed to have the panels centered.
Don't trust the displayed aspect ratio. It's set to something useful, but your cropped image is resized to fit the window.

/pnyxtr