]> luflow.net public git repositories - flow-web.git/blob - blog-posts/2026-06-10-14:01-flow-texpack-a-program-that-will-allow-you-to-generate-texture-atlas.md
Initial commit.
[flow-web.git] / blog-posts / 2026-06-10-14:01-flow-texpack-a-program-that-will-allow-you-to-generate-texture-atlas.md
1 author: Andreas
2 published: 2026-06-10 14:01:00
3 updated: 2026-06-10 14:01:00
4 topics: flow-texpack, Texture Atlas, Image Atlas, generator, Rust
5 title: flow-texpack: A program that will allow you to generate texture atlas.
6 snippet: flow-texpack is a program that will allow you to generate texture atlas from input images (BMP, HDR, JPG, PNG, TGA, TIFF, WEBP).
7
8 ---
9
10 [flow-texpack](https://luflow.net/git-repos/flow-texpack.git) is a program that
11 will allow you to generate texture atlas from input images (BMP, HDR, JPG, PNG,
12 TGA, TIFF, WEBP). The application generates both texture atlas and descriptions
13 file that can be read by a game.
14
15 ### Installing Rust
16
17 Install `Rust` from your package manager or by downloading from here:
18 [https://rust-lang.org/](https://rust-lang.org/).
19
20 ### Getting the code
21
22 Install `git` from your package manager or by downloading from here:
23 [https://git-scm.com/install](https://git-scm.com/install). The [git
24 repository](https://luflow.net/git-repos/flow-texpack.git) can also be browsed
25 online.
26
27 Clone the `git` repository:
28
29 ```sh
30 git clone https://luflow.net/git/flow-texpack.git
31 ```
32
33 ### Compiling the code
34
35 Build using release mode and install locally:
36
37 ```sh
38 cargo install --locked --path .
39 ```
40
41 The binary produced should be located here: `~/.cargo/bin/flow-texpack` (on
42 GNU/Linux). Make sure `~/.cargo/bin` is in your `PATH`.
43
44 ### Usage
45
46 Show available options:
47
48 ```sh
49 flow-texpack -h
50 ```
51
52 or
53
54 ```sh
55 flow-texpack --help
56 ```
57
58 ### Examples
59
60 Generate from input `data/characters` and `data/tiles`, write output to
61 `out/atlas` and enable the options: `premultiply` pixels by their alpha
62 channel, `trim` excess transparency off the textures, `remove duplicate
63 textures` from the atlas, enable `rotation` of textures 90 degrees clockwise,
64 `pad` each texture by 2 pixels and finally enable `verbose` output mode. In
65 `verbose` output mode `flow-texpack.log` will also be created which contains
66 more details of the generation process.
67
68 ```sh
69 flow-texpack -i data/characters data/tiles -o out/atlas -m -t -u -r -p 2 -v
70 ```
71
72 Enable `load filter` so that only `TGA` images are included in the texture atlas:
73
74 ```sh
75 flow-texpack -i data/tiles -o out/atlas --load-filter tga -v
76 ```
77
78 Enable rect heuristic `AreaFit`:
79
80 ```sh
81 flow-texpack -i data/tiles -o out/atlas --rect-heuristic area-fit -v
82 ```
83
84 Enable output `atlas size` of **2048x2048**:
85
86 ```sh
87 flow-texpack -i data/tiles -o out/atlas --atlas-size pot2048 -v
88 ```
89
90 Read input files/directories from `input.txt` but exclude all in `exclude.txt`:
91
92 ```sh
93 flow-texpack --input-file input.txt --exlude-file exclude.txt -o out/atlas -v
94 ```
95
96 `Adjust atlas size` automatically so that texture will fit:
97
98 ```sh
99 flow-texpack -i data/characters -o out/atlas --adjust-size -v
100 ```
101
102 `Adjust texture size` so that it will fit given atlas size:
103
104 ```sh
105 flow-texpack -i data/characters -o out/atlas --adjust-fit -v
106 ```
107
108 ### License
109
110 [flow-texpack](https://luflow.net/git-repos/flow-texpack.git) is licensed under the
111 zlib license. This license allows you to use `flow-texpack` freely in any software.