Do you have one of those handy Epson scanners, like the Epson Perfection 1660 or a similar number? One which has a little slide holder which holds four slides to scan together? And do you have a bunch of old slides that you'd like to scan and get safely on a CD, where they belong? Well, if so, you sound like me. My problem was that I thought I'd just automate the extraction of the four individual pictures into four separate .jpg images by using something like the excellent ImageMagick package, or possibly scripting the gimp.
Unfortunately, the options to pull images out of a relatively black background didn't really seem to work the way the documents suggested they might in ImageMagick. I think that scripting the gimp can be a little tricky, plus these are some really big images (120+ MB) which might take quite a while to process with the gimp. So I wrote my own program findslides which knows how big a slide is, assumes a 1600 dpi image but can be set to whatever you want (going to 3200 didn't buy me any more resolution), and then converts the input pnm image to four output ones which have just what you need. It automatically figures out if your slide is vertical or horizontal (you have to put it in right, of course!) It's easy to convert them into jpgs with Imagemagick or gimp or whatever, or you can use the supplied script.
This program is not as trivial as you might think. You can have some very dark slides, and some light leakage in the ostensibly black border regions. Take it from me: it will be a lot easier to try mine than write one from scratch! If your slides are slightly different sizes, you can easily tweak some constants. There are no external libraries needed, but if you run my script epson_split which calls the C program you will need ImageMagick installed to make jpgs. I wrote this under Linux, but it should be quite easy to compile under Windows or whatever operating system you have. Try it out; it's a time saver if you're scanning slides. The program is under the GPL.