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.4.zip
(230.3 kB
view hashes)
Built Distributions
patlas-0.0.4-cp310-cp310-win32.whl
(109.4 kB
view hashes)
patlas-0.0.4-cp39-cp39-win_amd64.whl
(128.7 kB
view hashes)
patlas-0.0.4-cp39-cp39-win32.whl
(110.0 kB
view hashes)
patlas-0.0.4-cp38-cp38-win_amd64.whl
(128.8 kB
view hashes)
patlas-0.0.4-cp38-cp38-win32.whl
(109.9 kB
view hashes)
patlas-0.0.4-cp37-cp37m-win_amd64.whl
(128.0 kB
view hashes)
patlas-0.0.4-cp37-cp37m-win32.whl
(108.9 kB
view hashes)
patlas-0.0.4-cp36-cp36m-win_amd64.whl
(146.1 kB
view hashes)
patlas-0.0.4-cp36-cp36m-win32.whl
(120.7 kB
view hashes)
Close
Hashes for patlas-0.0.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6975261e80ac37ba5960112101190076bffc9053ef5163ddb0e76aa1e197e3d |
|
MD5 | 7c8b952847547f60da1d7f0fe9296e68 |
|
BLAKE2b-256 | cd149756d3851067e9572b053a33d2fa543008d6236724ce9c716e95ded78264 |
Close
Hashes for patlas-0.0.4-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 345f2857ba749c9a2d62398cfca47d3ea415f709b66d87321b7f75e2e4a8100a |
|
MD5 | 3d62005312287f857a8ecea2ca5a680a |
|
BLAKE2b-256 | 9f512960b29d9867eaedeae4aa7f348697055d08aaaaf257b1987c49d3569465 |
Close
Hashes for patlas-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6aa464732e8f6754defa7908586d692e6a3fe053ffb1d6642033786eb6dc740 |
|
MD5 | 985b00cfd7e7004e1fdcdc6117333414 |
|
BLAKE2b-256 | acb84db2d525594f1d213f9719f93f1895bbe80466d99b99305fb9a13cd8f23c |
Close
Hashes for patlas-0.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a238111b2f1089c88804bc9cc1b3d502f2cc6d46759b7d5345175c931de3f81 |
|
MD5 | 93bc4aee1d45a588d9489a1c169549c6 |
|
BLAKE2b-256 | ae26bb6ca0978368bd2b2c426aae7d5fafcdeccbfbebe67712002ebdbcd1fdfa |
Close
Hashes for patlas-0.0.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47faa2b3e7d5b571104ec6d301c2829d59b568ac583157621d6be3f24561ceb0 |
|
MD5 | 08e017f5bb4ba6fa1f2786db155b472e |
|
BLAKE2b-256 | 6f2afa8da75c4264e4e351b9c3c3e82bffcc79b5898f7eeb87a9b9d867b3e734 |
Close
Hashes for patlas-0.0.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0abf1da0464c25ca3fbe7def379f5de32e1d9aed42595298f5ec012d085c077 |
|
MD5 | f1c4691d0ff87940ad3f01378bda1ebf |
|
BLAKE2b-256 | 3f4466d9577cf0c0d8a99eeeeb2b83f6ec4d6a8de8d5485dd39391e30100c0f1 |
Close
Hashes for patlas-0.0.4-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db01be50b11872575c2a36d683927336d76bf538c31bf7008db18a26158fd846 |
|
MD5 | 493a978517e0616d4e1e391029675a1c |
|
BLAKE2b-256 | 027e75d307ce080badfb2be974084adf5bfdb6294809f7aa67f95bc35bab4960 |
Close
Hashes for patlas-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20f6f5ad31958578d3e5f455b94658f1761b2a1ba8ffd6063521cf2bc55e6d4f |
|
MD5 | bcfc0c6fb413f9b0ac11cfcc1d1503da |
|
BLAKE2b-256 | 3f80352da6d14f9ee6e638b8af2c4bd6bc680b7492037cdf0db394e4cab87c8a |
Close
Hashes for patlas-0.0.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 074204ac6afcdf36c83d10095e2fcd91215893785bbf1a86fb58e35efdac134a |
|
MD5 | f11e58ef8a31b67e3befe7017ef8c195 |
|
BLAKE2b-256 | 68749e81b356e36c1b332e92781e61d03e030a8ecc90725a65b0209f9470a82e |
Close
Hashes for patlas-0.0.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4c44a10829b00cb6f70b1b9a3134947df2f1a584eabb8d3cf57a3bbd02b66de |
|
MD5 | 4db3f929c6478ea3820bdf24315fff18 |
|
BLAKE2b-256 | c312753c513516a47bb359cf1a6c286e73654bdc433017d09a3436aa0ff794ed |
Close
Hashes for patlas-0.0.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b18d942ea3f38d36f6f93940fab4777cf26fdf694bf5896390c7325983a75d0d |
|
MD5 | 662f5a28da39fadab2164f983a5b9aae |
|
BLAKE2b-256 | 7807bb20409c92a931e59a43389d86b45b639dc32327fb41a6192df8b36ec72d |
Close
Hashes for patlas-0.0.4-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49cc6fa37f133df6482af4a18e52956a63d25cf347a4181caf0c9684d28d4580 |
|
MD5 | 18e328ebccf7df00141a46ad67d45f67 |
|
BLAKE2b-256 | 1f7bf82a8ad42fc7e579e6a815dd0f0814f05d35c2c90aed0b768a1d2de611fd |
Close
Hashes for patlas-0.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 710145d439e89a88592958224dcc6355548f4bf226c484279ae16baddeb54c1e |
|
MD5 | b9bc1a86e47a260f9399232b835fe389 |
|
BLAKE2b-256 | 78461f21a193a195b7d32240ce117ec059397196716b14f54bdf494ed6d9ec79 |
Close
Hashes for patlas-0.0.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7e8c86d2945f7c8a50b834abdbb42752301d5da659a965be081b8b3cd45390d |
|
MD5 | 92cf361677844d10a42a48133ee05e31 |
|
BLAKE2b-256 | 3bf7e9edac3057a043b9aa165702dd88ba7053d56835d112f409e83bb3534eb1 |
Close
Hashes for patlas-0.0.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7107943f3cc6b021b8db4af77051ee3fd43812c7a1a08f89231499a087502ac0 |
|
MD5 | b6acadbee790d868b79d675630473d16 |
|
BLAKE2b-256 | c7ec67e88b86a3253a655273f22a5e47452288940a733c5cb48ab9caeef1aa52 |
Close
Hashes for patlas-0.0.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e8b840903f493aa5368d0072e46cd6b8ad3c512b485074e3e6487aa5a712032 |
|
MD5 | dfe5baa105df3732655cb4c64ace1a26 |
|
BLAKE2b-256 | c5629fa72ef318335bd4e690480fa582d4566cb4d1ace8e6e52662ce365fa409 |
Close
Hashes for patlas-0.0.4-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bef2e404a595c21927f40822f6df9092904fc17ca3b8344dbda38e6f8224ff79 |
|
MD5 | 64762e83b35a0557d4724ef07659f40f |
|
BLAKE2b-256 | a640cd245c61532e93fdd63a21fd73560df2ecf3c550339414a8768a14f41331 |
Close
Hashes for patlas-0.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31f1fc101f67339917d2af348c673e37abdd8803418b487e7d2f48b5ae75ac29 |
|
MD5 | 0170d87b1257108873bb97ec3a9f12d1 |
|
BLAKE2b-256 | b86b804f70ccbb8ed8ff4612f8aa8a9295c77a1dd9d40a2e18674b7c6ef5e53f |
Close
Hashes for patlas-0.0.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e63aec13b615d53284529358aafa1120f5b5aafe44bf0e104865614804d6f2e2 |
|
MD5 | f0717c55b21fb8fd75ebce1167c08385 |
|
BLAKE2b-256 | cd744a6744311d019bd60f547b879a76fc583766973f0f822c85dc893c9cd4e4 |
Close
Hashes for patlas-0.0.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df1e00bbee076e62851ee375fd8f91f2781100c714748d03bd1e81d6e5a045d2 |
|
MD5 | af625e400bad75ca6004a3951b8a6c8f |
|
BLAKE2b-256 | c9e79cd7b57f53815dc8eb0963cf7b0fa83490496df745b7a62c749cba1f0e37 |
Close
Hashes for patlas-0.0.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7b56192d59f8e109ab806ffcaa3ad23d20c81a3f4a5126a5744d1d9ec1beff3 |
|
MD5 | 4ec451d6661a9d199a3b322cb75d6b04 |
|
BLAKE2b-256 | cb34d041010e9be73210e0842ab3cbcce40b22877574febdaf0b8cdaf9619ad7 |
Close
Hashes for patlas-0.0.4-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17ffcd31f1a84fc70420c938bea667f2e133b5ba838ad4ccc3c4ebc0db198585 |
|
MD5 | dfc1edd6018c5c34d5090ee75a4a6cca |
|
BLAKE2b-256 | 22292deaa6dc29b45223c16f01c5a300c4799a05d88ab473a021d0b5980ff896 |
Close
Hashes for patlas-0.0.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7766cb94c205e370a93e99d871ed25daa46bcac9d49fe9791db34db211cdab7d |
|
MD5 | bfa52e9f460eb80492102fe773560917 |
|
BLAKE2b-256 | 17a8b9f2263c44fee0580550d388b140bc7c4ba0c338a0a6543c394133b45973 |
Close
Hashes for patlas-0.0.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 863bdfcece7f1b96f404b334af085b8a9c3974d4d2a3f95e48288512f851b50a |
|
MD5 | 2869c910f59d8f6bdbf21b41f5ce5f72 |
|
BLAKE2b-256 | 88cb6f983162356c161b3d08e43e97a47a966d807e91f4ac2f5ab1417d359659 |
Close
Hashes for patlas-0.0.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0328971f7706827837ed18a083707be7818ae30b75788514737f591e6361227e |
|
MD5 | 1504c93ddb5ef0cbfdff8d79e1b494f0 |
|
BLAKE2b-256 | 484bf9f2b7bb46f6e88430ef0422f328653c67c5cf71188180df19d5fd7f5a22 |