0.0
No commit activity in last 3 years
No release in over 3 years
Take a psd with layers, one for each frame, and output to a single png file with each frame placed next to the other in order of the layers in the psd.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
~> 10.0
~> 3.0

Runtime

~> 3.2
~> 2.13
 Project Readme

PsdToSprite

Convert a PSD with layers to a single sprite sheet for animations

Installation

Add this line to your application's Gemfile:

gem 'psd_to_sprite'

And then execute:

$ bundle

Or install it yourself as:

$ gem install psd_to_sprite

Usage

This gem takes a Photoshop file (PSD) that has layers, all the same size, and outputs each layer into a horizontal sprite sheet, with each layer laid next to the other, left to right. The ordering of the layers in your PSD will dictate the ordering of the sprites in the output png. The layer at the very bottom will become frame 0, the next one frame 1, and so on.

require 'psd_to_sprite'

sprite_maker = PsdToSprite::SpriteMaker.new("example.psd")
sprite_maker.process # => outputs to example.png
sprite_maker.process("foo.png") #=> outputs to foo.png

Output example

Note: Example image comes from the Phaser.js project

example

Contributing

  1. Fork it ( https://github.com/[my-github-username]/psd_to_sprite/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write specs
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request