• Forum
  • Lounge
  • How to extract an image from a sprite sh

 
How to extract an image from a sprite sheet?

May 12, 2014 at 6:00pm
closed account (z0My6Up4)
Hi, I have a png file that contains a sprite sheet with many images on it. I want to use a few of the images on the sheet in a game I'm making but cannot see how to select and save only the images that I want.

I'm using Linux by the way. Is there a special program to do this?
May 12, 2014 at 6:23pm
You could use the crop tool in GIMP.
http://docs.gimp.org/en/gimp-tool-crop.html
May 12, 2014 at 7:19pm
closed account (z0My6Up4)
Thanks - I never thought of using that.
May 12, 2014 at 9:25pm
Depending on the graphics library you are using there should be an option to only select a part of the sprite by giving the x, y, width, and height.
May 13, 2014 at 6:38am
If the rendering is hardware-accelerated, giblit's suggestion may be more efficient than loading each individual image into its own texture.
Topic archived. No new replies allowed.