问题
I have a lot of sprite images that contain dozens of icons. Is there an easy way to unravel the sprites into separate image files either automatically or feeding it coordinates, widths and heights?
回答1:
This program is pretty good at decomposing sprites into individual frames
http://www.alferdspritesheetunpacker.forkandbeard.co.uk/forkandBeard/apps/AlferdSpritesheetUnpacker/Download.aspx
it supports all standard bitmap formats, .png, .bmp, .gif, .tiff and does everything pretty much automatically.
回答2:
Use the slice tool in Photoshop:
- Use the
slice select tool
(note the select part of that, see screenshot). - Right-click anywhere on the canvas and select
Divide Slice...
from the drop down menu. - Enter in the height/width or sprite multiple.
- Once finished, go to
save for web and devices...
- When you save, this will export all the individual cutouts to the file format of your choosing in a separate folder.
If they are of uneven size (not on a grid) you can also select them individually with the vanilla 'slice select' tool. If you have a lot of similar grids, save everything as a photoshop action and batch process them.
回答3:
I encountered a similar problem after losing the source images for a sprite and built this relatively simple tool: https://github.com/fmovlex/desprite
Hope this helps.
回答4:
This one worked nicely for me to extract images from jquery ui sprites http://renderhjs.net/shoebox/
回答5:
give this as try as it will split it into individual rows: http://imagesplitter.net
回答6:
There is an android application that will dynamically split a sprite map:
https://play.google.com/store/apps/details?id=com.fourqueue.android.texture
回答7:
Creation of png:
I use spritepad to create the png image, just drag and drop your images to create the sprite: http://spritepad.wearekiss.com/ (but as I assume you dont want this step).
CSS:
After this I import the image to spritecow and get the css for every image (double click every image to get its height-width and coordinates): http://www.spritecow.com/
You could use spritepad only but I prefer to use it only for the creation of the sprite. For css, spritecow seems easier to me. Anyway its up to you.
来源:https://stackoverflow.com/questions/9385900/easy-tool-to-decompose-sprite-image