a python wrapper for astc-encoder
Project description
astc-encoder-py
astc-encoder-py is a Python wrapper around astc-encoder. It can compress images into astc textures and decompress astc textures into images.
Requires Python 3.7+
docs
TODO, check the pyi for now.
example
from PIL import Image
from astc_encoder import (
ASTCConfig,
ASTCContext,
ASTCImage,
ASTCProfile,
ASTCSwizzle,
ASTCType,
)
# create config like astcenc_config_init,
# color profile, block dimensions, quality, flags
# and then allow editing by hand afterward
# optional args:
# block depth = 1, quality = 60, flags = 0
config = ASTCConfig(ASTCProfile.LDR_SRGB, 4, 4)
# create a context from the config
# as the context creation is expensive,
# this solution allows re-using the context
context = ASTCContext(config)
# create a new image for testing
img = Image.new("RGBA", (512, 512), (255, 0, 0, 255))
# put it's data into an ASTCImage for handling
image = ASTCImage(ASTCType.U8, *img.size, data=img.tobytes())
# create a RGBA swizzle
swizzle = ASTCSwizzle()
# compress the image with the given context
comp = context.compress(image, swizzle)
# create a destination image with the correct arguments
image_dec = ASTCImage(ASTCType.U8, *img.size)
# decompress the data into the image
# the result has always 4 channels
# DON'T RE-USE THE IMAGE OBJECT FROM COMPRESSION, IT MIGHT SEGFAULT
context.decompress(comp, image_dec, swizzle)
# load the decompressed image into PIL
img = Image.frombytes("RGBA", img.size, image_dec.data)
TODO
- figuring out segfault for re-using ASTCImage
- [] creating ASTCSwizzle from strings instead of from ints
- [] creating ASTCImage directly from PIL.Image
- [] export ASTCImage directly to PIL.Image
- [] SVE support for arm
- [] tests
- [] docs page
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
astc_encoder_py-0.1.1.tar.gz
(138.6 kB
view hashes)
Built Distributions
Close
Hashes for astc_encoder_py-0.1.1-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e9fea7f41b4840f330a374c0e6c72eb122d49335c26ddb0ff52b1cc51cd2333 |
|
MD5 | b9fc70b393ff438c60f172937734ebbb |
|
BLAKE2b-256 | 70de1e61cfe539cb2871327befc3d1a90d47f0053b8347237f4fd0b668490377 |
Close
Hashes for astc_encoder_py-0.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8760c915290ef0613ae8966f71d81e4db87bbc54b522cdf4c9c7f67e12b316f5 |
|
MD5 | 15778e1ce8763baeae1989d5d0666c72 |
|
BLAKE2b-256 | acd0e49e4e7a0d81f254d9b8827e698aceee27c7738b363d9d97102faafe68c3 |
Close
Hashes for astc_encoder_py-0.1.1-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 640256e9b90cf492ab1d44a94789a57d36bf176d5a36688a68d80a458d6e6948 |
|
MD5 | 8f4a83c3afe1db8311d422ae3e15c9a5 |
|
BLAKE2b-256 | 6109d2de2a2a057291cda929758ba427e8e3f1bfc55d9bbf1327e05a67121951 |
Close
Hashes for astc_encoder_py-0.1.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 088938b86e1e9f9274f5cab80a46ef32dc8dc39fee74cec02d3f0f9503bd8409 |
|
MD5 | 6319335b61b0c5ad0546faa3da75aa4a |
|
BLAKE2b-256 | 8834ff437a99ffec3e35b9bb92fde3d549e1f0d0ec00de1ed4af0afd9ae9a10c |
Close
Hashes for astc_encoder_py-0.1.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d68aff0fbf2e430e54dbfdd9fda9bafe40cd23643b556f77a8a7578e776f717 |
|
MD5 | a92de1bd973fa3522565c34301db7f1a |
|
BLAKE2b-256 | b57e5631f028c52f8c4bda6cc048221c376ad430562b70fa613da173bf86a2e3 |
Close
Hashes for astc_encoder_py-0.1.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfe857a08cdfb0da7364084c1f4e966f7d2d263aeeaf5770249b5e24683d5cd3 |
|
MD5 | ff69ce2090df6d9e2846d0ce8ac17f2f |
|
BLAKE2b-256 | 07289f1c8965cd6ee74fe8252b2b9effa6b3dd7838e3b83718315289b3629a5a |
Close
Hashes for astc_encoder_py-0.1.1-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 972b9c70b88c79563e09e976b3b6f4b44dbab573793ec52bdae26d2f81252b85 |
|
MD5 | 57d23015e79a8987eec30e82362aabe3 |
|
BLAKE2b-256 | c9c898f6ad33af958143554ad5f0be6e62b351f574f14a96dc84fc0a3f4f8308 |
Close
Hashes for astc_encoder_py-0.1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8b9d05042c744c3b8e8efd8896ecbdac57122480bb8a6302b4f0e049b882e2d |
|
MD5 | 99673b85bcf1d5c47365fb5fd0626427 |
|
BLAKE2b-256 | c504f1a77c452f3cb4afd8564e86986c80e0cea8321f1edf2c793d8fe1bad7ee |
Close
Hashes for astc_encoder_py-0.1.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 135580fea3ae2164e0d2b66e1ae0b89067b40bcb1eb2da79febf48d0c4104931 |
|
MD5 | 649dfb9ac74f0810de9df83edea2680b |
|
BLAKE2b-256 | d20f08f6ff83205b1a03adc34616bd1880e103ed2ba7e1bd0925fe29c577c37a |
Close
Hashes for astc_encoder_py-0.1.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62b2c8d54ce3fe7229bea3973fdda6b00093c72f02ac8bfc0170e1300b1046bc |
|
MD5 | 17d87e7dbccd7bc1db774c335e8db97d |
|
BLAKE2b-256 | 7ba7ef03219731de0d3b0bb1bfa7e3e98ffba643c969530663f374c20e87f5b5 |
Close
Hashes for astc_encoder_py-0.1.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbb975937da6e1adb36a7e1532f67429157f6acb559dfe640b6bd56b8dbae2b4 |
|
MD5 | ac09dbce7c1bc129e48c201daf101ef9 |
|
BLAKE2b-256 | 749a86dab9a9889a008a631a3768c38f8ee6010388e18b6fb73b5981bfd6cce6 |
Close
Hashes for astc_encoder_py-0.1.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16db42b5a904fd4ae875d0a579d92609b065355af0bb174e23d16fa63564c2ce |
|
MD5 | 2f113688a5582a56f2272e85b9032c89 |
|
BLAKE2b-256 | 5a057753a39d117f1e57aeb7934160547dd69fb1465f96bc0497cbc1e8fa684a |
Close
Hashes for astc_encoder_py-0.1.1-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbf3b4b3559e3d4982b6021433625da6677a468194e7ccf7e7c921a66231bbf6 |
|
MD5 | 5452e5ce7213cee7ea44cbdde7185bc6 |
|
BLAKE2b-256 | d59871245ab3f31be34b986405af8c0515f45153254391ecd3e04fdd26211ea9 |
Close
Hashes for astc_encoder_py-0.1.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68cd0231c6385b8f5d6d8a0faf6090d3a142c2d969720592dff56d4bd6e76610 |
|
MD5 | eb6de8234246951b6ec251b3bdc54da7 |
|
BLAKE2b-256 | 12c48c0c9e96f0737f4872c99c93b5ed8bf1887c6ac76df564535771bab6f8d2 |
Close
Hashes for astc_encoder_py-0.1.1-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0e51738db821413ca19c0bb0131c90725a85d76749f18fdd36fc4096b043b4c |
|
MD5 | 03d72a16b1781aa062e79f926b876dff |
|
BLAKE2b-256 | cd5ff09a1f2ec44c5646e7ef91b5f4a00f46945b7aab5c2fff171804bec3ea34 |
Close
Hashes for astc_encoder_py-0.1.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09b1d1142713f99385a13bd6576d8ee00193d0afe66468869f79b23e89386955 |
|
MD5 | 18bb6a999e2cd25697bbb77e2227af27 |
|
BLAKE2b-256 | 62cdc2a383291640dacc636ccfb172ab75a6d744e58da6d9ed8f56ca71b93385 |
Close
Hashes for astc_encoder_py-0.1.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 492b077c3c41b8350dd6b2a45f718bead4011c62a07c9ded2a8ab4ebd172a0a1 |
|
MD5 | d8cc97a18b446b790cc8e9823c625ce6 |
|
BLAKE2b-256 | 8a2a2f093cbe9c2518c9f9f329c99e534f56ff69bd9c9513a7a229fc4a72efb5 |
Close
Hashes for astc_encoder_py-0.1.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6db2be9806ffd3eec792a70706b8fb9979fcaee9bff679e185a95618ec45765 |
|
MD5 | 5e1251cc488b8b07895886b6261ffd4b |
|
BLAKE2b-256 | 334a2d941cb09433607bcded482348ccbf53fedfd230c55e0fa49791e5b9f681 |
Close
Hashes for astc_encoder_py-0.1.1-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d9d6ee6a176ada9f4c8723caf354e2b6c3be86e72947baff5c31de8b2b7506c |
|
MD5 | 9733a76233fc6dcebd42f204ea0348fc |
|
BLAKE2b-256 | 373ebb484a92c8410a557ee4a6d29d443d54fe5965896bfedddbb9b116797fea |
Close
Hashes for astc_encoder_py-0.1.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7097ac65d367e9bec94387942e443de3f444e99ee9d9879e1f64532c9deb420 |
|
MD5 | d165a325fb15e37ee8f0922fb04304bf |
|
BLAKE2b-256 | 7204b6977b2c7df3636829cd682e6ed693f821ce9e33dcf5fc9e498fe907319d |
Close
Hashes for astc_encoder_py-0.1.1-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 607c564ea696e571cb202cc849f5505ce6a3810e62b9697f8080ace846aa9506 |
|
MD5 | 6c1cb428b3f5d9016f49567e0f1a86d0 |
|
BLAKE2b-256 | b45b1a6d10157b71ed656302734f3a3f8683e10dbc006f3ff761f332b0ef3c43 |
Close
Hashes for astc_encoder_py-0.1.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 451401feea3e009ce7d55a948332c8a6ff5dcc058333dacb29ad6cabe1fb63bc |
|
MD5 | e106aee5267e956e9c1983cf490b51aa |
|
BLAKE2b-256 | 706b94c2491027505fcf748cabdcb2ff4b5e47c8be0bdcd7dd087ac4d00375ee |
Close
Hashes for astc_encoder_py-0.1.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc45057c0a9afbff3dfef08257885a847faf428cdf3da0d7b4757efacdf8c821 |
|
MD5 | 8c91dfda4a783af1da4c5e10f87ad972 |
|
BLAKE2b-256 | 77d2d7690aeb146aa2064a212d66fb2ab9252ae803db03aa9cbb1ca51aa4c0a6 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b9e92fe786436f1a3dbeb5e3705ed2166fd40cd24bbe01935c7e1f0f9f9da63 |
|
MD5 | 0aeb8aadd96bf01aa9a017ba259fb6dd |
|
BLAKE2b-256 | 75fbfe849e6b494922c562f4db3580df744ae6a7443b8a3008d3b825b662c2e5 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73f41e7789a79a281d1eb663601b9717a64ca9c5df314a2083b813df11f41637 |
|
MD5 | 49320a38bd286f0e8887da9aa053f28c |
|
BLAKE2b-256 | d064c247ec98612015ee2943c51afbc25221f12c758575084edfd67c39ec62e4 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d611e1cd14fbb7f0a836f42178a9d4625ba05884eb3dd48b036d5dbca8aa4d7 |
|
MD5 | 863226d633eb64133f7e8cd8f5311344 |
|
BLAKE2b-256 | 979b8513155a24fa03f9d82c23f7b09cfea046d9c36e45e60541b55adb12577c |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f4c44c555316fc4f46acaab3f54010c16517ee0ca47ffe997b3702beb73b713 |
|
MD5 | 542866e7c20ab61a3a246a620d5f6fa0 |
|
BLAKE2b-256 | d6d40a0e7176441c80950119398b0104dcd29927c59d2c29cd2e09ebbfc29b94 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-musllinux_1_2_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 032c491d1a57df2900dd69b5faddfd69e1bf8a9d8162a0eb242dd4e7f742ce68 |
|
MD5 | aa6631037e696d270da39cc931e24e45 |
|
BLAKE2b-256 | a386c028c52f1d9d78441c0aedbe4054fc49a284ceeebd9dd90b18ca4026e5c6 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-musllinux_1_2_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88d55c504fb9fbd1af7f5ba1cc0031b0275c557c54bc22619a864b6a827a8505 |
|
MD5 | 16643fe6eab5e448e339bcc0d1a0d6a0 |
|
BLAKE2b-256 | 57c33d41778a098bf56398ff880b2582dfdef8bdeffe61079c1f2aecc688887a |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5768e8a5b28909a59ca7dc723aa1898c454644cf43700c7c704920a5484bf158 |
|
MD5 | 4d2210e5eeb29fd7be10dbbf3d1afbc6 |
|
BLAKE2b-256 | 013e18955b57fbc16434db05f9b6bed50c932b2139456608856c1469899d1412 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49703c8ee2bc99509fa58cc21e2ec5ab92998b8e0f9b36f829665a892a60049d |
|
MD5 | 26553abddc0b0cc2fcf540dc26cf4afa |
|
BLAKE2b-256 | 022c2cb4d228de0b9669815be676ea0fcd1233dbb83cc82de74c4528b70a99c8 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac7dca688e51c0f7aabdea2a952586094a9c3bb8f5c79439825cbcb086028c57 |
|
MD5 | e5c2524138e713d649b937824c595fb2 |
|
BLAKE2b-256 | b9b01e5617c38abba41f693a2bc28c80b2efe9a3396247276c57acc238841896 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77e6bafe1a06aad1c8151043811ad66485f36a51400399261e7d022a16c219d5 |
|
MD5 | 4dd8486fcda2684fdce42fbd363599c3 |
|
BLAKE2b-256 | 66997600e9969a7465b9ffe3e003ed239a12bf2d683d133101a7274ed7dc4160 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33e0dacce900102d7259237c3d6d187c5204fc0549df98a43b731e3a8f3b135d |
|
MD5 | f81f29dfe834c5665f06b4b5ee6abc1e |
|
BLAKE2b-256 | b533b89ad181b2e580a4ca2e5b7b8b259117d8f68ef94fb13c4133114320f9f7 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e15e875a680d258760ea832e7e9b9a29c052cbeff1438d4f3b499026ac2587b |
|
MD5 | 82b683351bf4acfce3819b7f38ed1ff2 |
|
BLAKE2b-256 | 343a8a572ba14ced84e52382fcb74d1d77852618a26c087e029872eafa49fc97 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 803154d3453a2b4fb8c79f5bf1a18a926d27483fe385cdf3b34e92b9b6c0f1c6 |
|
MD5 | 4d1bd77b013002430df7c67d6728e6b3 |
|
BLAKE2b-256 | 76b799f7e822190997a1c44693142ef1fa61c33414163b6b0007a093ec75bc91 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 912c12157944ed2c8819cc5c2547c173273333c4872dab4b5e09745a35e18c29 |
|
MD5 | b3b16339dfe80384b862b02cc76954cd |
|
BLAKE2b-256 | c06fcbf3fcdf7a9208876aa562b5566d828f761a78c69ff04ee191b795318712 |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b02b3025fa560cc5b46e2f749523e276591724112e9a3f88fc4e20961db8a35 |
|
MD5 | 26e187f1fa4b4fd7aaa0daaf78a9f014 |
|
BLAKE2b-256 | 725374c88107a5fd2c51ce9ef5546d2d5101ea1bb4ea873fff63597492fe3b0d |
Close
Hashes for astc_encoder_py-0.1.1-cp37-abi3-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d973fbefe4e0a85984f2a871892c775fc7eaf07ee1a5fdce6d1d0132d059e71d |
|
MD5 | ae5102db763c6fcb19b7a7c262e7da57 |
|
BLAKE2b-256 | a6a84546e3858b34105f57c7c16de3f3c20e4804a57cbeb11ce3451361f9798d |