Giter Club home page Giter Club logo

texture-atlas-generator's Introduction

Texture Atlas Generator

A texture atlas generator/packer written in one single Java file. Currently it only supports loading and saving of PNG textures, this can easily be extended to other formats supported by Java’s ImageIO class.

Besides the texture atlas, a .txt file is also generated with texture coords for all the textures.

Examples and further details are available at my website

The texture packing algorithm used in the atlas generator is the Lightmap Packing Algorithm by Black Pawn. The images are added to the atlas by area size (width x height), in descending order.

The source code for this application is released into the Public Domain.

Building

javac AtlasGenerator.java

Usage

AtlasGenerator <name> <width> <height> <directory>

Example

AtlasGenerator atlas 2048 2048 images

This will take all the PNG files in the images directory next to application and pack them into one or more 2048×2048 atlases named “atlas1.png” to “atlasN.png”, where N is the number of atlases generated. More than one atlas is generated if the PNG textures do not fit into one atlas.

texture-atlas-generator's People

Contributors

denizpiri avatar lukaszdk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

texture-atlas-generator's Issues

Thank you

I know the issues list is not the ideal place for this, but thank you for providing this code. It was a fantastic reference and guide for me when creating a atlas capabilities for the OpenGL ES framework, Rajawali.

Here is the resulting class for your gratification:
Rajawali Texture Packer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.