| master | development |
|---|---|
The Texture Packer tool efficiently combines multiple images into a single optimized texture atlas, minimizing memory usage and boosting rendering performance. By leveraging advanced packing algorithms, it maximizes space utilization and streamlines asset management for game development and UI design, enabling faster load times and simplified workflow.
- Automatically add images from a folder or via the command line.
- Supports input formats: JPEG, PNG, TGA, BMP, PSD, GIF, HDR, PIC, PNM.
- Exports to PNG (default), TGA, and BMP.
- Ability to trim input images to remove transparent areas.
- Option to set a border around images for better separation.
texpacker INPUT_IMAGE [INPUT_IMAGE] <OPTIONS> --atlas=PATH
INPUT_IMAGE Input image file or directory (space-separated)
--algorithm=NAME Packing algorithm (kdtree or classic, default: kdtree)
--allow-dupes Allow duplicate sprites (default: false)
--atlas-size=SIZE Maximum atlas size (default: 2048 px)
--atlas=PATH Output atlas file name (default: PNG)
--border=SIZE Add border around sprites (default: 0 px)
--drop-ext Remove file extension from sprite ID (default: false)
--keep-float Preserve float hotspot coordinates (default: false)
--mulit-atlas Enable multi-atlas output (default: false)
--no-recurse Do not search subdirectories
--overlay Overlay sprites (default: false)
--padding=SIZE Add padding between sprites (default: 1 px)
--pot Make atlas dimensions power of two (default: false)
--prefix=PREFIX Add prefix to texture path
--trim-id=COUNT Remove COUNT characters from the start of sprite IDs (default: 0)
--trim-sprite Trim transparent borders from sprites (default: false)
--xml=PATH The output file path for the atlas description in XML formatYou can browse the source code repository on GitHub or get a copy using git with the following command:
git clone https://github.com/reybits/texture-packer.git
make releasebrew tap reybits/homebrew-tap
brew install reybits/texture-packer- JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib).
- PNG 1/2/4/8-bit-per-channel (16 bpc not supported).
- TGA (not sure what subset, if a subset).
- BMP non-1bpp, non-RLE.
- PSD (composited view only, no extra channels, 8/16 bit-per-channel).
- GIF (*comp always reports as 4-channel).
- HDR (radiance rgbE format).
- PIC (Softimage PIC).
- PNM (PPM and PGM binary only).
Copyright © 2017-2025 Andrey A. Ugolnik. All Rights Reserved.
https://github.com/reybits
[email protected]