Loading custom image format

Hello all,

I’m creating a game (in an applet) that uses tilemaps, so I have a very large image that contains all the tiles I will be using. I created a custom file format for my tilesheet because it’s able to compress the file more then a png file. Now I’m having trouble loading in the images (I did a lot of searching before posting, but I’m quite new to java and I couldn’t find a good solution).

How would I handle the image files? I was thinking about creating a seperate class that will hold all the images, and load them one by one in a seperate thread, would this work good? Also should I convert the big image into alot of smaller ones for each tile, or rather keep the big image and draw it partially using drawImage?

And how should I load the image? All I could think of was loading the entire file into a byte array, then convert the data to an ARGB Int array, and convert that array to an Image, this looks very inefficent though.

Thanks in advance

Why on earth would you decide to invent your own file format when png is perfectly adequate?
Sounds like a waste of effort to me.

A couple of small reasons (the tiles are 16x16, I wanted them to be twice as big when loaded as image. I don’t want the tileset to be viewable in the browser, also I’m porting this game from a Basic game engine to Java, and I like it to have my own extensions :P), though if it’s not worth the efford then I’ll just use png, maybe I can corrupt the file and still get it loaded?

If you want them scaled up, just load the pngs and scale them up programmatically.
Tileset not viewable in browser? Nobody is going to look for them anyway. Worry about that when it becomes a problem.