What is TexturePacker
Ogre with CEGUI
TexturePacker is packed with great features for optimizing stripe sheets.
Import and Export
One of the new features with version 2.4.0 and above is the ability to import Flash SWFs as long as they are simple frame animations. You can also import the usual formats including PNG, JPG, TIFF and BMP. Export formats are PNG, PVR, PVR.CCZ, PVR.GZ and JPG/JPEG.
With iPhone 4 and the highly anticipated high resolution iPad 3, most developers want to use textures for both resolutions. This can be time consuming if done manually. However, creating sprites for both high and standard resolution devices has been simplified with TexturePacker's automatic image scaling for both resolutions.
TexturePacker has two options for layout algorithms. For simple animation and tile maps, the basic algorithm will be sufficient. MaxRects is the best algorithm available and supports enhancements such as trimming and rotation. Only the paid version TexturePacker Pro supports the MaxRects algorithm.
Besides the layout algorithms, another factor in the optimization of sprite sheets is the size of the output file. TexturePacker will automatically use the minimum texture size possible based on the imported sprites. You can also set custom sizes if needed.
Another way to reduce texture size and optimize your sprite sheets is to eliminate all non-essential transparent pixels. By removing the empty space surrounding a sprite, you can pack more sprites per sheet and reduce the number of sprite sheets loaded into memory resulting in faster rendering and better memory usage.
You can reduce memory usage to 50% by color reduction. TexturePacker will also add dithering to the image, keeping the quality closer to the original, except for some graininess. This process works best for animated sprites because the graininess is less visible.
Identical images are registered but only one image is added to the sprite sheet. This allows you to use the duplicate images in the animation but saves valuable space on the sprite sheet.
TexturePacker can convert the solid background color behind your sprites to transparent pixels. This allows the sprites to be packed more closely and a smaller file size.
Integration into Xcode build process
TexturePacker's built-in command line tool allows TexturePacker to internally update sprites during the build process. Because only sprites that have been changed are updated, you save memory.
Andreas Low is the developer of TexturePacker and PhysicsEditor. He has co-authored the book Learn Cocos2D Game Development With iOS 5.
Editor's Picks Articles
Top Ten Articles
Content copyright © 2019 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Diane Cipollo for details.