ctypes-based binding library for the xBRZ pixel-art image scaling algorithm
Project description
xbrz.py
xbrz.py is a simple ctypes-based binding library for xBRZ, a high-quality pixel-art image scaling algorithm.
Installation
Wheels are available for many platforms. If there isn't one for your platform, make sure you have a C++ compiler handy.
pip install xbrz.py
Usage
import xbrz
# pixels is a list of 32 bit ints representing RGBA colors.
# It is 32 * 24 long.
pixels = ...
scaled_pixels = xbrz.scale(pixels, 6, 32, 24, xbrz.ColorFormat.RGBA)
# scaled_pixels is a 32 * 24 * 6 ** 2 long list of 32 bit ints representing the scaled image.
Wand / Pillow support
You can pass a Wand image to xbrz.scale_wand(img, factor)
or a Pillow image to xbrz.scale_pillow(img, factor)
.
Neither libraries are required to use xbrz.py, however they can be installed via:
pip install xbrz.py[wand]
# or
pip install xbrz.py[pillow]
xbrz.py as an executable module
Passing raw RGBA pixels to python3 -m xbrz <factor> <width> <height>
via stdin will output scaled raw RGBA pixels to stdout.
License
AGPLv3, see LICENSE.md. The original xBRZ code is GPLv3 licensed.
- lib/ is based on code provided by Zenju under the GPLv3 license. See lib/License.txt for details.
Some changes were made:
- Added some
extern "C"
declarations to the functions I intended to call from python. - Removed some namespace use to avoid being mangled.
- Replaced a template that was fucking braindead even for a C++ developer with a simple function that takes two arguments. Was that so hard?
- Converted the library to use RGBA instead of ARGB.
- Added some
- xbrz.py is based on lib/ and is released under the AGPLv3 license, see LICENSE.md for details.
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
Built Distributions
Hashes for xbrz.py-1.0.0.post5-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78e1f32b815aba2f0468dd8ed130e8bb406af1d93ec8ae12ef28914be1585ae5 |
|
MD5 | 85d429a765f2b2b895028ac05fa89eed |
|
BLAKE2b-256 | 512630c54ba56686abff8d349bb635e83dbd5cbaa56a6f0d5bb27312cb3490e2 |
Hashes for xbrz.py-1.0.0.post5-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86e613b8261c73ec70ef2dcfc39892c62b1db05f583bf344d94853860dfcd85a |
|
MD5 | 53654c2c4e8a60ff7bf306bda815f326 |
|
BLAKE2b-256 | 685fa92f23eebcb14a221caa7c1f1891faafa433a3595b2d6570868893e8edb8 |
Hashes for xbrz.py-1.0.0.post5-pp36-pypy36_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a66169d9a05cee555e6c2c50af7a228f50667d472b2761a33de74cc77b6265d3 |
|
MD5 | 7730c6f2313b2189e8e18e06f75a77f2 |
|
BLAKE2b-256 | f6ee4e0d85b390c5c37474c9ab70f0e745b46e491fa762753ceeb478095b7d2f |
Hashes for xbrz.py-1.0.0.post5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 260ab7d3808615ae7a393729cce41ad14d8fb2496d574973b4a07e4baa52e7c0 |
|
MD5 | 5c100baaa72001c335279e4e81eedefd |
|
BLAKE2b-256 | 8beaf434e9e5ebdd795de9872e6a461031baf57bdec6ccb14d5d5ca782b9454e |
Hashes for xbrz.py-1.0.0.post5-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9df12a9a3e8f2ec5d4c75ec06f9924002ce3871a5283c067de69ac7484fabef |
|
MD5 | e0d678d1d238e5df6b24a7b372ef09f8 |
|
BLAKE2b-256 | ca3099038c4db816e24ccffe20f94bd3b25d2dbe1b4aa6bd06b8703f912b8e7d |
Hashes for xbrz.py-1.0.0.post5-cp38-cp38-manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 741dfd2ae9f4cdc12ce33d15af0954291038a7e70b2ba32ee782044cdc0c2d6c |
|
MD5 | 7c43cd19182deccfabd27df823a68296 |
|
BLAKE2b-256 | b8cb3be148bb4a0d7acd9f95db294b1b51ac407bea4f7aa48ff711c8b85c3ff2 |
Hashes for xbrz.py-1.0.0.post5-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87ea1030a82fa9e7fd81c00fffeb4c20b3b07aec71d107860622b28a75bdae2e |
|
MD5 | e578bfc4014b252b82e341878783a542 |
|
BLAKE2b-256 | ce859ec69055a4954b561704ce7be5898c0257e8daedd2e63fc2ec124cb5f6ce |
Hashes for xbrz.py-1.0.0.post5-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c748054be3dde48bea0724781d99d04f7661c3c8d3fba6db90ccdc95353531f |
|
MD5 | 8b249bfa39cf17c332d01518076aa7cc |
|
BLAKE2b-256 | 9677f37bbfd2850663bddc9da03ebf299df59f5363f55617c97a8531e769e818 |
Hashes for xbrz.py-1.0.0.post5-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd906726a2060ab8b88234b486da2d65f79f6b226aa935df552538acf014050a |
|
MD5 | 6629e91048b9293d518c22e79e2c0d5e |
|
BLAKE2b-256 | 3640f635b984162c1f4716b8de75d266a04b64f0de196bd8b8dfec5d90380949 |
Hashes for xbrz.py-1.0.0.post5-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2ac7f56ec7906cda8432a5fa490e7a4c490c1a60bcca6d735f02509c00ccce9 |
|
MD5 | 277a5561d3b66eb2b30f153aa9d68137 |
|
BLAKE2b-256 | 54902fd6d45bbdcc977d9bb45ce196377366b94cf57c7d18cf780893c7cc6af8 |
Hashes for xbrz.py-1.0.0.post5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05942c70f2217a5cb6b59635ece4e1f4fb18bb8bf4e430b316ff621d045688fb |
|
MD5 | f11fb127a564c9f24c1bf33eaf17471e |
|
BLAKE2b-256 | b44f9b7d75dcac22b789da2e6def0eece518d3a9cb8205d90ea0479780576912 |
Hashes for xbrz.py-1.0.0.post5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4890db33accdcca7550290119c8219352d19b5adcb22db509c45a378f948bb8 |
|
MD5 | eb3e5ad720f0ffeeb85cd4db975aec50 |
|
BLAKE2b-256 | 30d22d1cfb80219ddcec041e04a22d9081d7cbc1931431e2f21a839766ee13d9 |
Hashes for xbrz.py-1.0.0.post5-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d5a407715553220cf255ff672c905945ab078c260a4990161daf1d8ac921bbb |
|
MD5 | 4853ab917a96c9932a1bb8f9ab4964a6 |
|
BLAKE2b-256 | 41d25b4b25f1730889d9d98dcc774f067c664d8b19b6ece361973107e64836ec |
Hashes for xbrz.py-1.0.0.post5-cp37-cp37m-manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90b53b4154c205893c3510b66628a8a030b9989dde202fb710ef09ddb48aca62 |
|
MD5 | b6faa659c134625344700a17846074b7 |
|
BLAKE2b-256 | 6f784a22ef9a8bd1938c676133d09c8247c8b58322b24e391e2a31243c57fefa |
Hashes for xbrz.py-1.0.0.post5-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca0079acd825628b1efae9f9214b4325a5aa7e3ead1c0c53157023882bce855c |
|
MD5 | ed2958439a2063fc30337ae14af3e3f7 |
|
BLAKE2b-256 | 764cfc0149b25d395221084d74daaef387faf27b0a17323fc5ff90739a545597 |
Hashes for xbrz.py-1.0.0.post5-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d8259738a02e003c4858fbce502f35b09129eb3816aa9b48fa11f3f5f0f7e4c |
|
MD5 | 9b511efa562853c194aa885f0ab4f470 |
|
BLAKE2b-256 | 97b3ff5a238c27e111756b50b81b6f68db4f77ec3b974ef1da19248892dd80c5 |
Hashes for xbrz.py-1.0.0.post5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 698b58191603adddba496aeab13dc01be4381643394282f7e6b9b01aa9903a5c |
|
MD5 | 4f1e34cb30bd3a005f02819bf35bc5eb |
|
BLAKE2b-256 | f18b787083482c1e2c3830932b6aa265916f32f694434e35c3d4ffbfdec3398d |
Hashes for xbrz.py-1.0.0.post5-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0d46ec82c6c1dc60b01d44baf12f1a7bc1bc848323b17bcd9040368adcb0d98 |
|
MD5 | ad41d7fbf548899e67ca8e4bee8bc96b |
|
BLAKE2b-256 | b464e79bc8aae1d79c8287798bfc89abd847ad690eb8d4b4c654f73ee4582c57 |
Hashes for xbrz.py-1.0.0.post5-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9924a2e3a69c42b17601f534c00f970e08af8a2d6827f3bfa52fe3ccc8572b5 |
|
MD5 | 35998c9f98a009346e7a22009d6531bb |
|
BLAKE2b-256 | 5b899dafa047770c4135bcd5271b209a070b45f8d0ffa59fcdcac595d26e9c27 |
Hashes for xbrz.py-1.0.0.post5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2129609ed1feb4a418ccb88b7d39048e6232f5dafd89f352012757c6f6dff07e |
|
MD5 | eff59cc1c5347c8b31d1efabe8da9c2c |
|
BLAKE2b-256 | 70b488800247607e7205581b7b589770aa453ed8629d97e1a0227ab98070dac1 |
Hashes for xbrz.py-1.0.0.post5-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f582325698efba8d1488e955af77578eff8738bb4bb1d404a9f05cddfc60f6a2 |
|
MD5 | c9ba5c5c1ec0490625a7dd46e0cc51af |
|
BLAKE2b-256 | af94aff66cf8278e6886bc58134e4d2f7079dea4e679dfa94e2775e086d22d46 |
Hashes for xbrz.py-1.0.0.post5-cp36-cp36m-manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a827d4836b294b152ad431e031787ab8ba94cf402586cb9d80e07ed512d6df44 |
|
MD5 | c3c98ad51729ac39d802d38ff5462472 |
|
BLAKE2b-256 | cc67dae7818166a85c01342e6eb698586e387492526b3acfd15e996a5d25a436 |
Hashes for xbrz.py-1.0.0.post5-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49012b93cc77a8975e8e378ca3ea37675e8f5a09c535888d7304e108d358dbe5 |
|
MD5 | 46243c8e1009d5747831d5360c848552 |
|
BLAKE2b-256 | d369eea0e1657b0873c31dce00ff18804333697f73b6ecb45c4e42c4e5f01906 |
Hashes for xbrz.py-1.0.0.post5-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fc6e0c0c883fae6fcc1b439dc9b93609c55332c004ca3d600c10afa345bb9ec |
|
MD5 | 8788cc252709c0c93063b41f073d3134 |
|
BLAKE2b-256 | 615577eeaa0414b22752da4c73c5542573f21af6ed8c71113dcf1194b23e58b8 |
Hashes for xbrz.py-1.0.0.post5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34417e2cadd6458e833ebe75934944107d4a5d83d667d6e7eda7af3f54c3bc36 |
|
MD5 | 23bf001119f18081aaf75996df539799 |
|
BLAKE2b-256 | bf19488826e0fefb3def6664a042c68c9a7f35847ecbd06f4eb948b0c2bd8131 |
Hashes for xbrz.py-1.0.0.post5-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f2cdbd771bf20368a4481456e2aeb142a73f5c1fc2690479e4fd1c0ff455111 |
|
MD5 | dd8654dcd6f28b1c7cb61d19d8470c18 |
|
BLAKE2b-256 | 39d40a91a775b64b11f41aa8e1ecf275fda1f81e1bfc33d4d3d41f9dabc860d9 |
Hashes for xbrz.py-1.0.0.post5-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29ba97a82c601a30b7712d490db78f6c43308b522df2a695c95572bd4622d58e |
|
MD5 | 548565e075e192c4f4d99d45a0b2f656 |
|
BLAKE2b-256 | 220680199d582d4c327b82fe4af9835455a14eac17a153b1cfabe92059d1a3ae |