Image slicing tool?


I have a couple of several hundred MB tiff file (21600×21600) that I want to slice into thousands of little tiny images.

ImageMagick doesn't seem to have a good way to do this via the API or the command line tools (or did I miss something?) and it's using a billion zillion MB memory loading the file.

Adobe Photoshop handles the giant files amazingly well on my PowerMac G4, but ImageReady (the "save your images for the web" tool that comes with Photoshop) doesn't like the giant file so much and it doesn't support making that many slices.

Currently my plan is to just get the each file chopped up in maybe 4 or 8 smaller pieces and then hope ImageReady can deal with those better and then go through it manually.

But I'm planning to scale the original image into about 5 different sizes (that all needs to be chopped into slices) and then it's quickly degenerating into a bunch of manual work, so an automatic tool would be nice. I can do Linux or OS X, but not Windows... (Or if you, dear reader, want to give it a try then I'll be happy to send you the files).

(the images above are from the NASA Earth Observatory — their image collection is completely amazingly)

Here's another image from NASA:


I find that pbmtools tends to work on huge images (mmm, virtual memory) but to be honest this is mostly why I wrote Image::Imlib2 - I found it copes fairly well with huge images. Give it a go and see if it works...

Interesting. Sadly, I hadn't much time looking at your problem, but I certainly will when I get back from a little trip to Oslo today.

However, I'm running Linux (and Gimp), and it certainly seems possible to solve this in a galant manner.

A quick search with Google gave me a few interesting results, including this one.

It seems that the tool being described on that page is a Perl script, and thus only works for Gimp 1.x. I don't have that one installed - running Gimp 2.2 myself - but it should be simple to adopt it to the new Gimp 2.x API.

It seems to me that the tricks is to automate the repeating task of "Image > Guides > New Guide". From those guides, it is really simple to generate sliced images.

As said, I will have a look at this when I get back home, and I will certainly contact you if I come up with something interesting (and useful).

Maybe try Imager. It has a nice crop() method.


I'll second Leon's recommendation to use NetPBM, which is much more pleasant than the slow and bloated ImageMagick with its horribly complicated commandline interface. See ??man pamdice??, what you want to do is trivial.

You don't say what the format is? Its likely on images this size that they were generated piecewise, since the original system is also unlikely to have that much memory. I suspect tiff? Tiff files are collections of either tiles or strips (strips are common in scanned images). Its possible to redump the file with the headers (mostly) intact but with a single tile-per-file. See and the developerWorks article linked from that page.

i have hierarchical blue marble tiles and a small standalone javascript / svg viewer if you want...

the tiles are 129 mb - a friend Russ Smith ( ) wrote the tiling code. I can give you that too if you want.

hmm i did this with geotiffs using a handrolled python script with... crap the server's gone

"But I'm planning to scale the original image into about 5 different sizes"

PHP can do that oh so nicely, it has some great features for creating sexy thumbnails.

Try the GD perl module. I tried the exact same thing with imagemagick a little while ago with no luck.

Image Ready will do only up to 40 megs. It is mean to process images for the web; not for print out put; therefore the size limit.

If yo want to process the image through Image Ready, and I recommend you do, all you have to do is change the file size (not the aspect ratio) to somthing below 40 megs then process it in Image Ready.

Photoshop is the easiest way to do this. In fact you can make a droplet that will do all this faily easily and all you would need to do is drop the image into the droplet and viola!

If you need more precise info just let me know. It is very easy and you don't have to be a techy to do it.

Anyone have a very simplified step by step guide for slicing a PSD file in Image Ready for the totally clueless, myself. Searched on google but not much luck. I have the Adobe Image Ready and Photoshop but I can not access the help files. And how many kilometres is Oslo are you from the North Pole? If anyone can send me the help file from Adobe Image Ready for slicing that would be ideal. I have a PSD file around 2.6 MB and I want to scale it down to around 100 K to 200K. There are two images/photos. One big, one quite small. I bought one of those PSD templates and have changed the text. Just need to do the slicing. The thing is without a step 1, step 2, step 3 process I can not get any further. Many thanks, from the South Pole.

In Gimp, py-slice does image slices. In Mandriva, it's in the gimp-python package. Once installed, Look under "Filters: Web" to find the Py-Slice entry. I just tested and it works fine. (On a huge file, now I don't know...)

I tried it with Image Ready and it was fine - what for problems do you have with GIMP, because I´m a little bit experienced in this..

About this Entry

This page contains a single entry by Ask Bjørn Hansen published on February 17, 2005 7:28 PM.

Los Angeles at night was the previous entry in this blog.

KCRW to go is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.


OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.38
/* bf */