0

I need a solution to create one big image with sprites from ~100 single images periodically without intervention because the number of images and the images itself are changing over time. To create the sprites with e.g. http://css-sprit.es/ or any other toolu with a GUI would not be feasible.

Each image has a different width and height. Images formats are png, gif, jpg. My approach would be write a custom java program to concatenate the images vertically into one big image and create a json file to provide the coordinates for later processing. A google search returned me this java awt based tutorial: https://sites.google.com/site/javagamescorner/home/creating-sprites

Is there another way you would recommend to create sprites? There are a lot of (too?) complex tools and libraries and maybe there is an easier solution.

This Stackoverflow thread mentions a lot of java libraries: open source image processing lib in java

Community
  • 1
  • 1
remipod
  • 11,269
  • 1
  • 22
  • 25

1 Answers1

1

Since you didn't mention Swing or SWT, I'm going to give you a SWT approach.

Engineer an ImageBuilder. Follow the builder pattern, and design it so that it suits your needs. Extend it from CompositeImageDescriptor (if you look at the class' APIs, you'll instantly figure out how to draw the images) to work with ImageDescriptors, construct your sprite, then eventually cache the result so it can be used later on.

Georgian
  • 8,795
  • 8
  • 46
  • 87