Tools for splitting bitmaps into multiple smaller images

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
ammianus
Very interested
Posts: 124
Joined: Sun Jan 29, 2012 2:10 pm
Location: North America
Contact:

Tools for splitting bitmaps into multiple smaller images

Post by ammianus » Sun Sep 23, 2012 10:05 pm

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?

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Sun Sep 23, 2012 10:10 pm

I found a bmpsplit some years ago...don't know the url...
And this one : http://retrospec.sgn.net/game/tiler

ammianus
Very interested
Posts: 124
Joined: Sun Jan 29, 2012 2:10 pm
Location: North America
Contact:

Post by ammianus » Fri Sep 28, 2012 12:33 am

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.

kubilus1
Very interested
Posts: 237
Joined: Thu Aug 16, 2012 2:25 am
Contact:

Post by kubilus1 » Fri Nov 02, 2012 2:56 pm

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.

awye
Newbie
Posts: 5
Joined: Wed Aug 19, 2015 9:06 pm

Re: Tools for splitting bitmaps into multiple smaller images

Post by awye » Tue Feb 27, 2024 6:32 am

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.

Post Reply