Git Product home page Git Product logo

gattai's Introduction

Gattai

CLI tool to combine multiple images into a single sprite sheet.

Installation

Gattai can be installed with cargo using:

cargo install --locked gattai

Usage

Gattai has a simple and easy-to-use CLI interface powered by clap.

gattai -o sprite-sheet.png images/**/*.png

This command will output two files:

  • sprite-sheet.png: the sprite sheet containing all images.
  • sprite-sheet.json: the positions and sizes of all used sprites.

CLI Options

Gattai provides several options to configure its output, such as:

  • -o, --output-file: configure the name and format of the sprite sheet.
  • -m, --output-mode: configure the format of the sprite data JSON file.
    • map: output sprite data as a JSON map:
    {
      "sprites": {
        "path/to/image1.png": {
          "x": 0,
          "y": 0,
          "w": 16,
          "h": 16
        },
        "path/to/image2.png": {
          "x": 16,
          "y": 16,
          "w": 16,
          "h": 16
        }
      }
    }
    • array: output sprite data as a JSON array:
    {
      "sprites": [
        {
          "path": "path/to/image1.png",
          "bounds": {
            "x": 0,
            "y": 0,
            "w": 16,
            "h": 16
          }
        },
        {
          "path": "path/to/image2.png",
          "bounds": {
            "x": 16,
            "y": 16,
            "w": 16,
            "h": 16
          }
        }
      ]
    }
  • -p, --padding: configure the padding between the sprites and the border of the image.
  • -s, --spacing: configure the spacing between the sprites.

Supported Image Formats

Gattai is able to use all image formats supported by image, the only restriction being that output formats must have an alpha channel.

License

Gattai is dual-licensed under either

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above without any additional terms or conditions.

gattai's People

Contributors

lechintantudor avatar

Stargazers

Trent avatar Michael Gonzalez avatar Sebastian Thiel avatar Daniel Halo avatar Reuter avatar  avatar toyboot4e avatar

Watchers

 avatar

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.