GithubHelp home page GithubHelp logo

art-packer's Introduction

art-packer

Sprite sheets generator written in python

Features:

  • CLI and Python interface
  • Allow recursive folders walking
  • Support of multiple sprite sheets of fixed size
  • Configurable padding between sprites in the sheet
  • Duplicate sprites detection based in fuzzy threshold
  • Auto-crop sprites by transparent pixels
  • Supports PNG, GIF, JPEG and BMP for input format
  • Supports PNG for output format
  • Supports JSON for output metadata format

Dependencies:

pip install pil

Installation:

This software works without installation, but if you want just run

sudo python setup.py install

or even

pip install artpacker

Usage:

./bin/art-packer --input-path [path-to-sprites]

art-packer's People

Contributors

miroff avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

autious ht154

art-packer's Issues

Issue generating metadata.json on debian without python module simplejson

This is a minor issue, but these notes may help anyone that comes after me.

When running the script on a debian machine

Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux

Using packaged python version 2.7.3

I get the following error:

Reading image resources
Packing 20 images to sprite-sheets
1.png 20 images was packed with pixel overhead of 24.19%
Traceback (most recent call last):
File "/usr/local/bin/art-packer", line 5, in
pkg_resources.run_script('artpacker==1.0.1', 'art-packer')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/artpacker-1.0.1-py2.7.egg/EGG-INFO/scripts/art-packer", line 10, in
main()
File "/usr/local/lib/python2.7/dist-packages/artpacker-1.0.1-py2.7.egg/artpacker/cli.py", line 102, in main
verbose=options.verbose).generate()
File "/usr/local/lib/python2.7/dist-packages/artpacker-1.0.1-py2.7.egg/artpacker/artpacker.py", line 91, in generate
self.metadata_saver.save({'sheets': sprite_sheets, 'sprites': metadata})
File "/usr/local/lib/python2.7/dist-packages/artpacker-1.0.1-py2.7.egg/artpacker/metadata/json.py", line 14, in save
content = BANNER + json.dumps(metadata, indent=' ')
AttributeError: 'module' object has no attribute 'dumps'

Note the last line.

Installing the debian package python-simplejson turned out to be a quick way of fixing this issue for me.

From what i can gather from this post: http://stackoverflow.com/questions/11369734/python-json-module-has-no-attribute-dumps

The reason for the error might be the compounding circumstances of having a file named json.py and not having simplejson available thus falling back on the json module. This might result in that the json.py file gets loaded incorrectly due to its name.

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.