Git Product home page Git Product logo

spriteman's Introduction

spriteman

A small script to extract/combine sprites from/to a grid. (-> full name: sprite manager)

Dislaimer

This is a freetime project done in not that much time, please keep in mind that I won't work on issues as soon as I can because it is no prioritized project. Also, please mind the LICENSE.

Please note further

Currently, it can only extract single-tile sprites, a multitile-detection may follow if I'm motivated enough. Same goes for combines sprites: I have not tested it with multi-tile sprites yet.

Also, the ´--make-alphaoption forextract` has not been implemented.

Building

git clone https://github.com/thebreadcompany/spriteman.git
cd spriteman
swift build

You may wish to use swift build -c release instead of swift build, depending on whether you can confirm for yourself that the tool is roughly doing what you want and debugging is not nescessary.

Usage

The built tool is in .build/[debug|release]/spriteman or depending where you downloaded it of course. It is always advised to create a (hidden) directory, add that to your PATH and put your executables there.

Extracting

Basically just spriteman extract <file> --tilesize <tilesize in px>, combined with --output-direcotry <dir> if required.

Combining

Even simpler, spriteman combine <directory>. The output-file is named after the input directory.

Output notes

  • The output files are not yet completely optimized for space (neither for px area nor for disk space), so the following points may get improved
  • all output files have a generic RGB colorspace (8 components, 4 bytes per pixel)
  • all output files have an alpha channel, independently of the input file(s) having one or not

Credits

Escpecially important to aknowledge how to obain pixel data and create CGContexts

And of course

  • Apple for their amazing programming languages that makes this stuff fun to learn
  • my brain to somehow get the idea to write this tool simply because I found icon (yes, not sprite) maps on Nintendo developer

spriteman's People

Contributors

thebreadcompany 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.