To reduce the number of switchings between textures at runtime, I try to insert support for mega-textures (atlas) into the engine. To generate it, I write a Win32 Java utility that receives several image files with the contents of texels as input, giving mega-textures plus a configuration file with meta information for it. In order for the utility to work, you need to connect to it a ready-made Java library for program work with pictures (picking yourself in the format specifications for too long).

Required functionality:

  1. The ability to distinguish a picture with an alpha channel from a picture without an alpha channel.
  2. The ability to insert one picture into another and save the resulting file, plus apply a couple of simple filters (scaling, cropping).
  3. Support tga, png, jpg, bmp formats and convert between them in different directions.

Surely something similar already exists, so I request a prooflink to the site / documentation, etc.

    2 answers 2

    I can recommend ImageMagick + interface on java to it jmagick .

    Can get up with the pictures just wonderful things. Cut / glue / apply effects / scale with anti-aliasing. Jmagick has only one drawback - it works a little carelessly with memory. If you encode pictures during the day, you can eat a couple of memory gigs.

    • Thanks, look tomorrow. Memory does not matter, since there are not very many textures and all these operations need only be done once. - igumnov

    See also Marvin: http://marvinproject.sourceforge.net/en/index.html And also: https://github.com/rkalla/imgscalr