Simple texture atlas packer
Project description
A simple, dependency-free texture atlas packer.
Basic usage:
from patlas import AtlasPacker, load
from glob import glob
ap = AtlasPacker(side=2048, pad=2)
ap.pack(glob('images/*.png')) # list of images
ap.pack(['images/image.jpg']) # can call multiple times (packing quality may suffer)
ap.atlas # memoryview of RGBA texture
ap.metadata # dictionary of image locations
ap.save('atlas') # serialize as custom .patlas file
atlas, metadata = load('atlas.patlas')
See demo.py for example usage with ModernGL.
Features/limitations:
- Uses
stb_image
andstb_rect_pack
from stb under the hood- Can import any image format
stb_image
can (see here)
- Can import any image format
- Only square RGBA textures (currently)
- Optional OpenMP support (disabled by default to reduce wheel size) can substantially reduce runtime. To enable, build from source with
OMP=1
set in the environment, e.g.OMP=1 pip install patlas --no-binary
- On Windows, should "just work"?
- MacOS may need extra packages, e.g.
libomp
from brew - Linux may need extra packages, e.g.
libomp-dev
on Ubuntu
- Save to a custom
.patlas
file - Includes a command-line utility (see
patlas --help
for details) - Requires Cython at build time (but source distribution should have pre-generated
.c
files)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
patlas-0.0.2.zip
(229.5 kB
view hashes)
Built Distributions
patlas-0.0.2-cp310-cp310-win32.whl
(109.1 kB
view hashes)
patlas-0.0.2-cp39-cp39-win_amd64.whl
(128.3 kB
view hashes)
patlas-0.0.2-cp39-cp39-win32.whl
(109.6 kB
view hashes)
patlas-0.0.2-cp38-cp38-win_amd64.whl
(128.3 kB
view hashes)
patlas-0.0.2-cp38-cp38-win32.whl
(109.6 kB
view hashes)
patlas-0.0.2-cp37-cp37m-win_amd64.whl
(127.7 kB
view hashes)
patlas-0.0.2-cp37-cp37m-win32.whl
(108.8 kB
view hashes)
patlas-0.0.2-cp36-cp36m-win_amd64.whl
(145.6 kB
view hashes)
patlas-0.0.2-cp36-cp36m-win32.whl
(120.4 kB
view hashes)
Close
Hashes for patlas-0.0.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 373d4dc6a9bdecf4ce353d589d4a87f763146f1f85ef0e3f1a78a50d580e50bd |
|
MD5 | a2817de8869be13ab69d6d500e8b0d30 |
|
BLAKE2b-256 | da3bc83dee624b679b83085d2fff3b48617a9b946b76bc318b1a2a718c56e4db |
Close
Hashes for patlas-0.0.2-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c19c73cb2c8be5162fcb2b7b1ded130f7c4a54f51442f098c7c694a3882cbb6e |
|
MD5 | 386b7dd169a695ec89610e88df6d6c34 |
|
BLAKE2b-256 | f2ed74ed06c621475b4ff10de8da994209e6d405ae2f7cfcc096dacb643a6dcb |
Close
Hashes for patlas-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d836fd298eb3e292cac1b8a81ec5f75efa55a86d079a39022b6fdec68450213b |
|
MD5 | 110780313756d0422239e4fe33f69872 |
|
BLAKE2b-256 | 4e7dca2f4120681e6b8cb274a5aea2b143698f59f89bd91759071e11c1abffcf |
Close
Hashes for patlas-0.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09684e405d30cf554c6e89c610daf127b8e8e3fad741975df34d87a172b13461 |
|
MD5 | 3820df1928b9533cace5b6970d34ad26 |
|
BLAKE2b-256 | 67d4e540ae6890c6dec814916481578e8880396af342db3578578c3c285ed1eb |
Close
Hashes for patlas-0.0.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54c2df1b7e6882a7851432acbba5573f919449b8d487dac8c1369cb40950e10d |
|
MD5 | 240e481f4af7edea92656371bffc38f9 |
|
BLAKE2b-256 | fd9e981290bbbc77310dc53aa2cfc697e7645210e4eeb0cc17c7fde1dc6ad0c1 |
Close
Hashes for patlas-0.0.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a342f306c473e41578a2b9ac769a603511777510dd78eaa81c8ed6b10fa9528 |
|
MD5 | 7798c8a47a894f15a7b6d8d610eda358 |
|
BLAKE2b-256 | fb8e37acf997b6008305ddb290da0e9d100213201b3273be4393be2f1320f816 |
Close
Hashes for patlas-0.0.2-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc109a63bf8a6fc1247b3ffc66b327b674e8345f2a242d2f240ff7a63572d8d5 |
|
MD5 | d2b4c3a09dc90eaa8d1f11c5913854c2 |
|
BLAKE2b-256 | 6e9bf7b3b8c189aef94535024b5b11550fa077994b1f75564a5dc772cfbee0e6 |
Close
Hashes for patlas-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2db04a70d5b70fbf6e5661657127c24f28f9da15bfc954da4032c90fa812959b |
|
MD5 | cd6b91c8ad18c8a5bfa7808241b977e6 |
|
BLAKE2b-256 | 938a109b801e1bae8d5a93166ed05ae18fa7d91f8d56c5bbaf7e8f8d7f71da7d |
Close
Hashes for patlas-0.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 572830223ea5dde5f92205382eb4ee629ee644be3009b8093b88ff3e0caf1ee4 |
|
MD5 | a45e97cd9c1c88a76ea113525d986262 |
|
BLAKE2b-256 | e7c945afab49b42fae1efd5ec3befc58040020f2ac1c87d19e4480b7c4d08c56 |
Close
Hashes for patlas-0.0.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ead61ddcd918d569ba2efba7f94e90f6b09e8a32e410ee8a5cfc0e922834991 |
|
MD5 | 2ed65f05eaa3d555e56978d173b8232a |
|
BLAKE2b-256 | 16c8ac2815ff76ab0c7ac60c8eb0e743e1a9c418370803d8a5d93abce5afb65f |
Close
Hashes for patlas-0.0.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfab93238dba25e9c99bfa030b490833048b10f2c90758ecf838d7c186dd96a4 |
|
MD5 | 9f27d63fd588babab0a31e5a0181f2b8 |
|
BLAKE2b-256 | 655fc8e710d06588f07a99d5b9063017565e703eb2fdcaff3d07d79e108273e5 |
Close
Hashes for patlas-0.0.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e21242078970cf679e10faa8624465ddaa145fab379821a26f911d176927a764 |
|
MD5 | 9f31f7eda1f8bc3435cc885742faeec3 |
|
BLAKE2b-256 | 06270bf2a1363249ba461e91ea3d777996b182d125c3ff9f3a2ef7a815c096e5 |
Close
Hashes for patlas-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab7a42b6a4909bd193541b87512a312397eaa8c6d94720678c96274a0a41db89 |
|
MD5 | 8a6d50ee1cb90282c3f0d66e59d614b6 |
|
BLAKE2b-256 | 39ca90e409fc59147bab28dd22b196544560b6d67689f364d1051e981c8fc5d1 |
Close
Hashes for patlas-0.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5ac868dfc935334a045fcb60b9738554fa4dcab0dba6e2fc47d9c717f9e6a5d |
|
MD5 | e51dfdb2345700a7796b1859975bfeb0 |
|
BLAKE2b-256 | 47130d8f3e2042238bf18fe3b947238def96bb4e3dcf64861e725ee04f46a0af |
Close
Hashes for patlas-0.0.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e58bfbbd38889fe36ae18b6cd09b278136c402d9320c1c72ae84f8817d6cac4 |
|
MD5 | 0a55a1d0f0fc01bc93716d9933cfa804 |
|
BLAKE2b-256 | d06f98cf09bcdb4b97012db1bf1a7fb62d127470061a07805420655ab16a87a2 |
Close
Hashes for patlas-0.0.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d12ecca26fd817cf311917212cdb6e1d3206a588171299c0198400fab840b3f2 |
|
MD5 | aa004cf93042395354e250d7210796b8 |
|
BLAKE2b-256 | d6c3d7687f7be3951c0c52772996998de2f83643e6f8439d92650d1b19b3e6d4 |
Close
Hashes for patlas-0.0.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06d0b627be7837dac03840e2534ff2a4f7ec9c1c2004a881983cacd0ac75981f |
|
MD5 | b760c56a53382f95c5ecfccd09ab6628 |
|
BLAKE2b-256 | b0b183ee5cfc0801a38304f60bf6da20b04d8c4200e53a80ef77f3816da39b3a |
Close
Hashes for patlas-0.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6df7049fb20a45c4da6f0be78d9538e53ad5a3d4c22a741fec7a88ed74a8a5a0 |
|
MD5 | 138e4259001a000dda8413758e4888b0 |
|
BLAKE2b-256 | ed5a42c7f4b08a427ed658f9f6352e12f2023a72438ad71c38dd4656a7390d0f |
Close
Hashes for patlas-0.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0a748d100f2eecd5fef1ea451513736daa7323861d311c60237daef869fca8 |
|
MD5 | 9f0d3ca55225c947afb4efdad20dc419 |
|
BLAKE2b-256 | 7a5475f87790187d4e46010f91548e801e069e8833b36c4d3efa3a665a953d96 |
Close
Hashes for patlas-0.0.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24d977a454e0581eb27108372ba9d1c75ca6a2cf9ac5696724d7a8333672f4fb |
|
MD5 | 1bad7749edba776ebef41d5af4d22a7c |
|
BLAKE2b-256 | b660a6c5b804f14834f517704306d8689283de4fce1b87f3e2f7e680f980e8fa |
Close
Hashes for patlas-0.0.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 212b1371c079209dc21923477de0d19fa5407624468e8dc654628cec00d70fea |
|
MD5 | a78ab4196a8c1842fc87fc91d1169aa5 |
|
BLAKE2b-256 | d27f07b21aa08e5a089cde2861bcf1b08341dff0a53c529b7e33fda57ea42a5e |
Close
Hashes for patlas-0.0.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca8d5d249dc2f30bb2623337c9d7767f3f8e6f827447431dd539ff20664cd190 |
|
MD5 | b77370ae8b43c63675e9e4c1053ea00e |
|
BLAKE2b-256 | 41ca45a1c34fd063f271102e1cefaa716a62c9e33ab11b312e2abeedc96c422e |
Close
Hashes for patlas-0.0.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7079dd710f99263d8b0a090b32ac0e88e35fa4b4e7825509f094a5d430c79f15 |
|
MD5 | 49c5122d0cd21d418b76b580578c3e23 |
|
BLAKE2b-256 | 8fb641a5db860b2c3940ea349d482bf5f497309c72c8e1eb0a601efce128838e |
Close
Hashes for patlas-0.0.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0988f32c3555f1914afdc00d3a0ffdbbc0fb9b85f6a7065dc0b40e9fff2b3411 |
|
MD5 | 0fe893ee8f62dfc64c570a7013b0fb7f |
|
BLAKE2b-256 | cbeaba12297d227bf9d831d62bd3cc86f43590c81ff77d19faf9161b1673027a |
Close
Hashes for patlas-0.0.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 411e50a0590b0c15d18e0cfca3d3eebbf9a4c847768b529fa65d35c9b853ec34 |
|
MD5 | 789d21a675176e8495b6eed2bd39c5dc |
|
BLAKE2b-256 | 05baaa07cf988ea348e3abc0fda9d4cbb3f43258a69df0913bb80f3515f81770 |