Page 1 of 1

Tools for splitting bitmaps into multiple smaller images

Posted: Sun Sep 23, 2012 10:05 pm
by ammianus
I was wondering if anyone has any recommendations for a tool that would be able to read a bitmap file, and based on the size of tile you wanted, split the image and create small bitmaps for all the tiles produced.

I have found this online http://imagesplitter.net/, which lets you upload a file at a time, but from my experience, didn't quite create even sized tiles. I would also prefer something offline.

In my case, I need a tool that can work with 256 color windows format bitmaps and I want to create 16 x 16 px size tiles out of potentially much larger images. These tile images I will then programatically compress and add to my game's data using sixpack. This is for 32X eventually, but I just need to manipulate the image files, so that shouldn't really matter.

Have i just missed the incredibly obvious somewhere?

Posted: Sun Sep 23, 2012 10:10 pm
by KanedaFr
I found a bmpsplit some years ago...don't know the url...
And this one : http://retrospec.sgn.net/game/tiler

Posted: Fri Sep 28, 2012 12:33 am
by ammianus
KanedaFr wrote:I found a bmpsplit some years ago...don't know the url...
And this one : http://retrospec.sgn.net/game/tiler
Thanks for the link. TileExtractor seems to work... but it's UI is very, very retro Windows 3.1. Did they intentionally do it that way :?

:edit: it appears to be unstable for me too. It crashed already :?: . Im on Windows 7. Oh well.

Posted: Fri Nov 02, 2012 2:56 pm
by kubilus1
Imagemagick can do this. Here is some code I've used to take a large jpg image, convert it to a bitmap, split it into tiles, and reduce the colors for use on the genesis:

Code: Select all

convert in.jpg -resize 320 -colors 64 -background black -extent 320x224 -crop 160x112 +dither -despeckle -colors 16 -depth 4 out_%d.bmp


The order you put commands in Imagemagick is the order that they are done. So I am first reducing the X dimension to 320px, then reducing the colors of everything to 64, then padding the image to 320x224, then cropping into 4ths, turning off dithering. Now I reduce each of the four tiles to 16 colors.


The nice thing about Imagemagick is that the input file type really doesn't matter a lot. For what you want, you might do something like:

Code: Select all

 convert input.bmp -colors 256 -crop 16x16 out_%d.bmp 
This would take input.bmp of any size, reduce the colors to 256 and crop it into a series of 16x16 tiles with the naming convention out_0.bmp ... out_N.bmp.

Re: Tools for splitting bitmaps into multiple smaller images

Posted: Tue Feb 27, 2024 6:32 am
by awye
yes kubilas is right You can try use ImageMagick for splitting bitmaps into smaller images
convert input.bmp -crop 16x16@ out_%d.bmp
and you can simply use online application for efficient image optimization such as jpeg optimizer.