Simple texture atlas packer
Project description
A simple, runtime-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- 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 patlas
- 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.3.zip
(230.4 kB
view hashes)
Built Distributions
patlas-0.0.3-cp310-cp310-win32.whl
(109.4 kB
view hashes)
patlas-0.0.3-cp39-cp39-win_amd64.whl
(128.7 kB
view hashes)
patlas-0.0.3-cp39-cp39-win32.whl
(110.0 kB
view hashes)
patlas-0.0.3-cp38-cp38-win_amd64.whl
(128.7 kB
view hashes)
patlas-0.0.3-cp38-cp38-win32.whl
(109.9 kB
view hashes)
patlas-0.0.3-cp37-cp37m-win_amd64.whl
(128.0 kB
view hashes)
patlas-0.0.3-cp37-cp37m-win32.whl
(108.9 kB
view hashes)
patlas-0.0.3-cp36-cp36m-win_amd64.whl
(146.0 kB
view hashes)
patlas-0.0.3-cp36-cp36m-win32.whl
(120.6 kB
view hashes)
Close
Hashes for patlas-0.0.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 494d184b6708d6dd0280489f8f4b3ec251dc154b548310304edb60dfbac712d2 |
|
MD5 | 45208f87847af61dcfae07292b60395c |
|
BLAKE2b-256 | 7b7c06045a009b228364075678bb500943360e2028f4b6d201b4ae3b5c4e8281 |
Close
Hashes for patlas-0.0.3-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30bbd89bf3d32c1867d1a07e1839f9f671fd9ce7f1295e29b818abf3d4f590db |
|
MD5 | c971837c8c2be710e3edcc21f626b65b |
|
BLAKE2b-256 | 7a7896d0df1ae6133f1921a8167607b94beb6a328b2736ee316e56e60a469878 |
Close
Hashes for patlas-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b44ed230e208e8332651c89ea12004be41d2b16a40b3475a50be98c21a1148a |
|
MD5 | eb720b94be0c94165abf498fe970281c |
|
BLAKE2b-256 | e8c9b2fe7d4152a1258e228a46accfb85e8640e4eb6ba97889617d51988a9923 |
Close
Hashes for patlas-0.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c632557b002f828ccf1e019e07038bf1fe27d76f09e6473494eacd1bf715b165 |
|
MD5 | c506bc6fc9ed29a97690f97841dab6f5 |
|
BLAKE2b-256 | 5c174053d311da41e0ad85daafbb84ec92b6e75089cdaced638480e6e04dcd83 |
Close
Hashes for patlas-0.0.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f47d91e3be4c8350ded4a76b135a1688f374e309c646de6bb56364320aa41b4 |
|
MD5 | 51f1fe71613ccc015afe4e2299e9be56 |
|
BLAKE2b-256 | 0d39dc95f8f5f904fcf1bc0d1b956c2311c99be7003fb0c337c0151c209607d8 |
Close
Hashes for patlas-0.0.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 108136fd184217e0bcf8b00c9c3b7ea8a6654830dce062a80e84523053460867 |
|
MD5 | f30ee739cc2a626be8e696b35b8ebfea |
|
BLAKE2b-256 | ee4192397f925b519df85f57596c33beddba529c21061d6846b0de4204a4408e |
Close
Hashes for patlas-0.0.3-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89abdc78c739fcce21be249e0edde84a71d41a9e5bb02da86c14ab0c270e6205 |
|
MD5 | 03c0e98c838a6152bd4df0475ddc99ea |
|
BLAKE2b-256 | 3934ad02ca90ee84c9d50391b9d30ee0f6cb5105b1fb14a8d76f85e3196104af |
Close
Hashes for patlas-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c50a0b133d0d9b92e8fb9f88cb98bf09ed24cbf472791347ddd008d7c774c44 |
|
MD5 | 7cbd523117744a168c8f4ffcda31a44a |
|
BLAKE2b-256 | cdc5bdfdd3f7183edf652349dee6895d17a263e910c0dd7bb8dc7c0a7157f979 |
Close
Hashes for patlas-0.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c61094e7b3d375dcb5599bf336099c9973368076046570bab7b24a20903eadf |
|
MD5 | 61eefbbd58b29244affa3acc42cc6f5b |
|
BLAKE2b-256 | 4354024e9a71fb4fc3ba7e1027a47040600453cb1de1eb5d2425735f16779563 |
Close
Hashes for patlas-0.0.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f25e856c50350df21bb3e7309aa4073dcbc9f19f8c4c7f156ba37246fff9c3c0 |
|
MD5 | 3bad0cbe6b77bde1819695ba2310fee5 |
|
BLAKE2b-256 | 77e2c52785610f47818c63c0ae65d3e1ebd7f153ddbb40a991673844e2ae70fa |
Close
Hashes for patlas-0.0.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f1f73bd961c4a2467c0f92a8d5e8bef93533ad9b7cfc42a888677fc0b159338 |
|
MD5 | e54d303de31c02225ebbf65e8489c5f2 |
|
BLAKE2b-256 | 96000aef92fa1668d908ff92ab3dec40eaca952ab941192604c62de8b045910d |
Close
Hashes for patlas-0.0.3-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3407c2226cd65f3d56992963f2e6b37701f1c1d186b88817576802b3167d01c |
|
MD5 | bcec1d898e50132b6245b70a2119a302 |
|
BLAKE2b-256 | c9b37b3f295b457d7423f73695f37e6555deac8d4cd8a1c72db3a3282cc2c3c7 |
Close
Hashes for patlas-0.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 445681ab73f87af06e29b3df7ae7d7bbc16005917aa44e60880d55f81d2a8007 |
|
MD5 | 85220abae98800053ff6a6e21183c644 |
|
BLAKE2b-256 | bc50e7393a7964ad3403aab049b1a6f50659c0bfc32a0d22e41b555c65777950 |
Close
Hashes for patlas-0.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f881bc0758298ad2095759be477ff9f270102661d484020cfe24c282674f86b8 |
|
MD5 | 33435f02130a2fc0f0e6c28d14be3480 |
|
BLAKE2b-256 | e318cd03a36dd64f2d073a5de2633de130516bbf31556c4ca90cc20a222e3c19 |
Close
Hashes for patlas-0.0.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b75e2506fab50ab18fff723eb234ee1fca59b6519b7ee9893d64ae7ce1a066d |
|
MD5 | c77b91ac47ec70e682a7073c79e843d6 |
|
BLAKE2b-256 | 3b369b89100bf156e3f41ed3e68bf03f52381a267d9f5ad9a68acaa12f551e0c |
Close
Hashes for patlas-0.0.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72d2418d5cc59a37759c359ae63f02b5ad6f058f85663a6adf556e6eac9436c3 |
|
MD5 | 57c2754d5891182d2ddc1a9ddfa927ca |
|
BLAKE2b-256 | 52d892e713351c1b2875774ed73d7220625613eab4a54056c111c2eea844691e |
Close
Hashes for patlas-0.0.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c35aaada1a3b68667cd59a105dde6d8e6a50f0d1f642c425af513b9bc51e592 |
|
MD5 | 7d7eb6312f246869706675194e236088 |
|
BLAKE2b-256 | 7de204c33cf5f9e257cb2910c861c70f962505bee64120f24be8b04e98d616a6 |
Close
Hashes for patlas-0.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd99b240c656883e9944345202a6045c3d2458db2979988eea46f8f6a557284a |
|
MD5 | dba9493bfec19247cc589f056331ae5b |
|
BLAKE2b-256 | 4d032bc309d0ed6d3303c1c11ca148c293a335f09cfb45857bcfb7ef459850ff |
Close
Hashes for patlas-0.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd5d260ca1eeabf3e2695cf14d943b2edac5bfa4c54094fcc23bdf5e340d03ce |
|
MD5 | d70ffd4378d74088289f28b9cb97a5da |
|
BLAKE2b-256 | 0a3c4a209c09721077d4b5838ef706b6bcf65d5ccf7d9f0ed9f8bb6e3a0215e9 |
Close
Hashes for patlas-0.0.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bcd634bbf4104ddb4af8e4e4cccd4ec57f2d90a0d1366c164b3ebac6f86c5d9 |
|
MD5 | ab20541a372eb3228cea954c14c7f430 |
|
BLAKE2b-256 | b97150d22c8c3cafd692cee888c0cee55a6ac03f96165f6f11894c93097efb77 |
Close
Hashes for patlas-0.0.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35164b260aa9f75fbc770ad7ff2b912c5f02a2a48d347f78a1bf9e67c649dd05 |
|
MD5 | 21263949d0d232a98a34c2b5d97d8976 |
|
BLAKE2b-256 | 1772c2ccab554fb39b4e027da5185232b8be682830a52c671e955c344debedbe |
Close
Hashes for patlas-0.0.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c0cf3af57624c55e9788a4581d78240d436da1ffec8225084707f7867aa0820 |
|
MD5 | e4388c2cefa458b8ea8caf0aaa37ed6a |
|
BLAKE2b-256 | 184d6b988bfb85cf1f6155d08485478aaaabacc195240708db8b1e96598bfe0e |
Close
Hashes for patlas-0.0.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 474f8e92470e986305301524282181f9c99bf10159d7011839cf274e765fa94e |
|
MD5 | 68179ed91376cc2f300b0ee439671d24 |
|
BLAKE2b-256 | 3fc774cda2bebf7b27a0129493c2feed6aa589bdbf737185ca3bc79a5dca1e06 |
Close
Hashes for patlas-0.0.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7a7b042aa33c5cfe29a54388aa430509d1864e812b70cc158635ea09e66d818 |
|
MD5 | 77ad773efd7e4f5f69abda2d038a83c2 |
|
BLAKE2b-256 | 87a448edd3b0c2bb34c52771c4c9aa1760c9e5bf760ddd3e306a0fc6dc139ff6 |
Close
Hashes for patlas-0.0.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08565a21e343b7e802f7ecb014ac44a1314a90c0769853d864842339c530814c |
|
MD5 | abe9fbbf43588b83323005a93227c16a |
|
BLAKE2b-256 | 579310220c6d39e5bf5363b6443287ae1e5e1b6679fac2a279d04d5702f015a7 |