[Gllug] Splitting image into (many) tiles.

rich at annexia.org rich at annexia.org
Mon Mar 4 14:34:41 UTC 2002


On Fri, Mar 01, 2002 at 05:53:44PM -0000, Zverina, David wrote:
> I would like to split 21600x21600 image into many tiles. Has anyone heard of
> any tools which will do this and work on files this big? (This pretty much
> excludes any tools which try to do this with GUI interface).

OK, ignore my last posting.

You could do something with a small bit of shell scripting and
the "pnmcut" command.

eg. The following would split into columns, and you can easily
modify this to split into tiles.

#!/bin/bash

# Assumes original image in jpeg format.
image=my_image.jpg

i=0
while [ $i -lt 21600 ]; do
	djpeg -pnm $image |
	pnmcut -left $i -top 0 -width 1000 -height 21600 > col$i.ppm
	i=$(($i+1000))
done

#----

Rich.

-- 
rich at annexia.org | Is your school part of http://www.schoolmaster.net ?
BiblioTech Ltd, Unit 2 Piper Centre, 50 Carnwath Road, London, SW6 3EG.
+44 20 7384 6917 | Free software: http://freshmeat.net/users/rwmj
Copyright © 2002 Richard Jones | GnuPG/PGP key from www.annexia.org

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list