Easy tool to decompose sprite image?
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.
Generating CSS sprites for dynamic images
You can check and try jawr (https://jawr.dev.java.net/) library for generating/modifying (also compressing, merging) css files on servlet. It has option to change background images dynamically.
You may arrange bundles for switching css file(s) for changing skin(s).
Plus side: You can also manage and arrange your .js files too!
How to get the size of sprite in a sprite Sheet?
You do know how many sprites are there in each row and column right? then just divide the width with how many sprites are there in a column and divide the height with how many sprites are there in a row.
(I may get the column and row wrong, I'm not native English, but you should just switch the row/column if the first try didn't work out)
Related Topics
Overriding Styles in Material UI in React
Tell Less to Not Freak Out in Certain Special Cases and Ignore Weird Characters
In HTML Table How to Force Cell Text to Truncate and Not Increase The Width of The Cell or Wrap
How to Select Nth Child of Specific Tag with CSS
Command-Line Argument as Var in Sass, for Hardcoded Cdn Url's on Compile
Firefox-CSS: Border-Radius Issue for Pseudo-Element "Before"
Add All CSS Files in a Folder to Nuxt.Config
How to Select Element with Specific Content or Attribute in CSS
Colors in Bootstrap Custom Download
How to Animate Path Shape Without Using Smil
Requirejs: Loading Modules Including Templates and CSS
Gm_Addstyle Equivalent in Tampermonkey
iPhone Xr/Xs/Xs Max CSS Media Queries
Modify Alpha Opacity of Less Variable
How to Import CSS from Node_Modules in Webpack Angular2 App
With Webpack, How to Generate CSS Only, Excluding The Output.Js