| Crates.io | tex-packer-cli |
| lib.rs | tex-packer-cli |
| version | 0.1.0 |
| created_at | 2025-10-07 12:22:18.244387+00 |
| updated_at | 2025-10-07 12:22:18.244387+00 |
| description | Command-line interface for tex-packer: pack folders of images into texture atlases (PNG + JSON/Plist/templates). |
| homepage | https://github.com/Latias94/tex-packer |
| repository | https://github.com/Latias94/tex-packer |
| max_upload_size | |
| id | 1871598 |
| size | 131,730 |
Command-line tool for tex-packer. Packs images from disk into atlas pages, writes PNGs and metadata (JSON/Plist/templates).
cargo install --path crates/tex-packer-clicargo install tex-packer-cli after publish.parallel feature so --parallel takes effect.
cargo run -p tex-packer-cli --features parallel -- <args>Subcommands:
tex-packer pack <input> [options] (writes PNGs + metadata)tex-packer template <input> [options] (forces --metadata template)tex-packer layout <input> [options] (layout-only: no PNGs; exports JSON/Plist)tex-packer bench <input> [--algorithm auto] [--auto-mode quality] [--time-budget MS]Global flags: [-q|--quiet] [-v|--verbose] [--progress|--no-progress]
Metadata formats:
--metadata json-array (alias: json) — JSON array layout--metadata json-hash — JSON hash layout--metadata plist — TexturePacker-style Plist--metadata template — Handlebars template (use --engine unity|godot|phaser3|phaser3_single|spine|cocos|unreal or --template <file.hbs>)Examples:
tex-packer pack assets/kenney-ui-pack --out out --name atlastex-packer pack assets/kenney-ui-pack --algorithm auto --auto-mode quality --time-budget 500 --parallel --metadata plist
--parallel requires building with --features parallel.tex-packer template assets/kenney-ui-pack --engine unity --out outtex-packer pack assets/kenney-ui-pack --metadata plist --out outtex-packer layout assets/generated --out-dir out_layout --name atlas_layout --metadata json-hashtex-packer layout assets/generated/basic --out-dir out_layout --name basic_layout --metadata plist--export-stats out/stats.json writes { pages, used_area, total_area, occupancy }--mr-reference (quality better on large sets; slower)--print-config (useful to inspect YAML+CLI result)--include "**/*.png" --exclude "**/ui/**" (multiple allowed)-q/--quiet suppresses logs; -v/-vv increases verbosity--progress/--no-progress toggles progress bars (default on; disabled by quiet)--auto-mr-ref-time-threshold 500 or --auto-mr-ref-input-threshold 1000You can provide a YAML file via --config to set options together. CLI flags still override where noted.
family: auto # skyline|maxrects|guillotine|auto
skyline: minwaste
heuristic: baf # for MaxRects
use_waste_map: false
max_width: 1024
max_height: 1024
allow_rotation: true
border_padding: 0
texture_padding: 2
texture_extrusion: 0
trim: true
trim_threshold: 0
power_of_two: false
square: false
sort_order: area_desc
auto_mode: quality
# Portfolio controls
time_budget_ms: 500
parallel: true
# MaxRects split/prune path (reference-accurate)
mr_reference: true
Built-in engines: unity, godot, phaser3 (multi-atlas), phaser3_single (single-page json), spine (.atlas text), cocos, unreal.
--metadata template --template my.tpl.hbssrc/templates/.Compact context shape:
pages: [ { image: String, size: { w, h }, sprites: [ { name, frame:{x,y,w,h}, rotated, trimmed, sprite_source_size:{x,y,w,h}, source_size:{w,h}, pivot:{x,y} } ] } ]meta: { app, version, format, scale } (JSON exports include full atlas meta with schema_version)--parallel requires enabling the parallel feature in the core crate when building from source.--release to improve performance.meta.schema_version = "1".schemas/tex-packer-atlas-hash.schema.json and schemas/tex-packer-atlas-array.schema.json.--algorithm auto --auto-mode fast|quality tries a small portfolio (quality tries more MaxRects/Guillotine variants).--time-budget <ms> limits candidate evaluation time; --parallel can evaluate candidates in parallel.--mr-reference toggles reference-accurate split/prune. In quality mode, the core auto-enables mr_reference for MaxRects candidates when time_budget_ms >= 200 or inputs >= 800.