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 C++ template with a simple function that takes two arguments.
- 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 Distributions
Built Distributions
Hashes for xbrz.py-1.0.1.post1-pp37-pypy37_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd4e4fc17d51b5baa0d84d9d11ee80b47b8102b6da1fc459fa01ffae83ba48fb |
|
MD5 | 9f31ddffc571fa0560ba95616cc8be31 |
|
BLAKE2b-256 | 0bcf91d69650df8e74df8a61d1fd9038e2ecef440867439e81de6c15524a1540 |
Hashes for xbrz.py-1.0.1.post1-pp37-pypy37_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a06700651e1abe0ac86877f9a89ada9e1c1e12fed64d53f4aa2bb84c4ef3d056 |
|
MD5 | 3b77f9ec56705e160a5bc951b2764b16 |
|
BLAKE2b-256 | 3178d25bfd73f2869b4ecde0df0809342f82fd796052a0891e5a5b32a16e4147 |
Hashes for xbrz.py-1.0.1.post1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ad46896279be9d43620d467001b12030d6694ca0d6153f6fadb79dce164ed0d |
|
MD5 | 7a8c4e00e1520a50d107777fbd64e477 |
|
BLAKE2b-256 | 8043b50062decc80e10289bd6f16f0c78d971e485a99b0cc1c762ff0b1f01179 |
Hashes for xbrz.py-1.0.1.post1-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9516fce1dbb426554a904de34d8ecd2d456bb1bb6a00de5719140aaff73f5e4 |
|
MD5 | 165ff476057245932f677e8e7728dd83 |
|
BLAKE2b-256 | 852a4d15b35321835b76e60c8fe9d422a21c40439840a9e7645de43cae3953f0 |
Hashes for xbrz.py-1.0.1.post1-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa38d0a9332f04d52110f2f588fe2538b6cf4427c5edc8edee38c1b6d5b912c6 |
|
MD5 | 2a2188fcf64b6cd4ff7b18037bb28826 |
|
BLAKE2b-256 | 4411772d50fff48c19c56364575b052d1b711c0b855d423d0f6973a90d923242 |
Hashes for xbrz.py-1.0.1.post1-pp36-pypy36_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f002fcbb56d0aa2ee99576973301debdfa63307f12b6d23272609600d0f9cde7 |
|
MD5 | 233c157163333ad7985c7db505c36b31 |
|
BLAKE2b-256 | cea30a8ad64d0d9d5589a38f0d3e0d9ef185e4ee5e05217add30bd2c1a8e748f |
Hashes for xbrz.py-1.0.1.post1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40a41237f256efa12e72449297f34b4166e5dc61d29684905eb61ecdc0a36058 |
|
MD5 | 35603f5dd7424d895c2a0e1cc4ab3eeb |
|
BLAKE2b-256 | d18a53ab5c103485205f95ca179c02379cc3895d7db82c5bff22ca39f7a147ba |
Hashes for xbrz.py-1.0.1.post1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e74d91ab36687a977886bec091debce2f4c21324c134b464606cb3c0989ef41 |
|
MD5 | ce045e9fb61d61c3458fe79838cdaedc |
|
BLAKE2b-256 | 7f1b10e45ab175c56db4b6dd79d5e18c049f07b6b827e400a8ca1b0c85a233e9 |
Hashes for xbrz.py-1.0.1.post1-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 923d928d67500d66ceb5ebc50c4267d6efe60df6fbbb5319f5266685d49e5f97 |
|
MD5 | 461f23e22c0db715561c13fe23148839 |
|
BLAKE2b-256 | 3dbe89061cbc7355ba6edb8b9b4e661b40cfd0e89c15ced20aa8de9d58a0da48 |
Hashes for xbrz.py-1.0.1.post1-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d78e38897f784a858c2a64ee7268b2641b42c91d514bb962c35e233cfd62fdb9 |
|
MD5 | aa4b031aec635a7962893daa8569afc0 |
|
BLAKE2b-256 | c0f7a0728bdbc750cb8a54d7771c9243c3935f5124e6fa14a8d6294f96d5cfdf |
Hashes for xbrz.py-1.0.1.post1-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6442707c16bffcde45e00ffddff60d24bd39a8cc3ed8484a8c15176280bdfe1f |
|
MD5 | d99ce767c66dbe102316ce6c79d989ec |
|
BLAKE2b-256 | 0066a9ba6632e6d8d6060ceb34635309b23979e2d392b59c1dfd4201fa2fced2 |
Hashes for xbrz.py-1.0.1.post1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e70aa4d17b3e53874d140fa8ffb26d118622fe0a40dd196765c27be5f29342bc |
|
MD5 | 868353c7501a4ad576ba043d34ed7583 |
|
BLAKE2b-256 | e95fd82f9a072b7720a91beefd479ae5feb7b42260ebf73cc8c44b21b8c4e999 |
Hashes for xbrz.py-1.0.1.post1-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0abeea194d3b2d106cf3ccf317fb7f3b5c808db0fbcbfe18f82eb994a86f48cd |
|
MD5 | 455060004699f301ee7f436a9aa37d2d |
|
BLAKE2b-256 | 272426ce5413abda4caf8542d80a77e2ea879eb41d6f9c57687f547bb7e1042c |
Hashes for xbrz.py-1.0.1.post1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ce6cd428a3da905fa60b5a49ade2f8f729caa41f6a6d121d7f19dc6a531d16 |
|
MD5 | ee948c3e725c3b92f17ec9524ee5f617 |
|
BLAKE2b-256 | 2d51914cf8b94968408a40177ee17dbfab85465a21885c43156e93bacac6eb0a |
Hashes for xbrz.py-1.0.1.post1-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dddc054e2410a311f92f44c945269ec8e61540d1d9154fff2c663cfd8ab46d3d |
|
MD5 | 2390db996a457c7dd549862b3b3e931a |
|
BLAKE2b-256 | d20945771c19b4957633673e0cd19e107def60375e969a396f6d5ca2f5986f32 |
Hashes for xbrz.py-1.0.1.post1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dd33265728f500f02272de657420a128a9b09f727d2e55824d03986f69da98d |
|
MD5 | 290d062b124c916ec2b861193a3a8d99 |
|
BLAKE2b-256 | bc67de1ca1d28f4963608738aad1b1232c86dc0768ac5c4b5dc9485fb8db23ea |
Hashes for xbrz.py-1.0.1.post1-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3288152946a2aaa3a14806fa7266e7968100df0ba9dd5cc50c46ee16ec90872 |
|
MD5 | 670f4de75cb54f6e0f1a2f534d556a06 |
|
BLAKE2b-256 | 69b2adc59646766d5151f0d05b42e4701c9e4e822b669b4f8b3612f4b61d5e03 |
Hashes for xbrz.py-1.0.1.post1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4bc95e514bca91e15c52dd7404d25058ca503fded4c980d7e0fc987cf441cda |
|
MD5 | 9f177161261fa5374fa2c336b552f230 |
|
BLAKE2b-256 | af3f5635106d74b6ce3acb0ae74a0b321460da204529fffdbaeaee3c58462a2f |
Hashes for xbrz.py-1.0.1.post1-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d0388d2c5180fd1f88b83231de6c7b8896ec9f4a05070fd203401a0d65fa55 |
|
MD5 | 79c791a42052a1d189172ee12b4001cf |
|
BLAKE2b-256 | 9998500bf74d8365cf7ee74b3cd22971453612b5e780d76b91f01a2894747b9c |
Hashes for xbrz.py-1.0.1.post1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1d529265074c6496401a847bb27dc15b9d5eaa8880a749ff44259cc169a9ab1 |
|
MD5 | 7773bdcd93ad98a3c8e205851374fa69 |
|
BLAKE2b-256 | 0bd6c40f769c38d1d7eea95ba032da2d61de58cbab24b4ea698d9d351f4975cc |
Hashes for xbrz.py-1.0.1.post1-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36476bd287e616da2163d1199bf240030bd87c6523dda0b3bf79c6a91eb7244f |
|
MD5 | 538a263584bf19a7a779e5c78820ba86 |
|
BLAKE2b-256 | 815bc3db3c01f9b641bd7f5f69dee564f70ec8ecc62ece386ff1a92440f6b58b |
Hashes for xbrz.py-1.0.1.post1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d188ea3e42a37877afc5b498b0e60e1a653fddb03a83663b6f09557ab74676b |
|
MD5 | 62a542b65e2f7ad9262459a23257e11a |
|
BLAKE2b-256 | 9183fb782653a8c6d605bbb0b396be744d18d9131ffead8fbf3fadb9b2a5a130 |
Hashes for xbrz.py-1.0.1.post1-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bf8ed944e530b6399d994b9d2a6457e98528d52498e0ff7dea4c46d9f119cff |
|
MD5 | 0f092d728d0581c0482c5489ec3283d1 |
|
BLAKE2b-256 | 85b67ec71e8a9dd83cbb49ed29fe506136487d5e43f2e048205f66b9328dfb8d |
Hashes for xbrz.py-1.0.1.post1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 493d9799a8053c8a09d15b3ddeeb16ec568f2935a42bfa336c3354de6767481f |
|
MD5 | 325b834d3fb877c1411e26b83fddadca |
|
BLAKE2b-256 | 2495ffc4d1a7e166ae23ab5ccac6cff09062adc5f892e53f5258f135f45e0159 |
Hashes for xbrz.py-1.0.1.post1-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65361c60538676af1e7048f13778f124146443664bf47b654cac3412d68cdf6e |
|
MD5 | c018f6c392bf6290c9f24de9f2c6ee79 |
|
BLAKE2b-256 | 1fa451edd5a53bc51b4b576c2be6d3b36a7ed7967ef0ad3734346ba005848436 |
Hashes for xbrz.py-1.0.1.post1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81a21ff559476daac09938f9975b0c670c464f31771201d7fcf9c4478daf47f4 |
|
MD5 | 1287bcd9460abcca7cb9514cbca58ec6 |
|
BLAKE2b-256 | 654722b2ab1ef3c71e873900d9faf662f0b2533d6dc972dabd4a3b29cc731f16 |
Hashes for xbrz.py-1.0.1.post1-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2f75ce6685bfa18856576d2189f4f2d5352e2bd36c8198c8caf01273284474c |
|
MD5 | 5a15bf5412a3a4e88121cf59e8ad4e3a |
|
BLAKE2b-256 | dd64a1ec015ada47a11dac33ac9648a4fe5bc71df99e70947ecf98e6b7a65268 |
Hashes for xbrz.py-1.0.1.post1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ed82cfa1cdbb70c64901392825d88f11d89941d2b0a8bc8ff9329fdfc88f8e5 |
|
MD5 | 185424e033a98831fe3f89f10c845e0b |
|
BLAKE2b-256 | 9638376864313a767f53e72fbbd0a7a7f61afd90dadccc43a74e036c818c7f79 |
Hashes for xbrz.py-1.0.1.post1-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34c51cb8139905dd613962daa42c02a3823d6100cfc3a4a66e9dad10d35573eb |
|
MD5 | f4514f913de93f2afaa2ccafb3202285 |
|
BLAKE2b-256 | fcb35c9149b777cec66a8f0facf66875f17d64219bdf09061f418c98ddec2fb1 |
Hashes for xbrz.py-1.0.1.post1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d27741250a46c82321d2f4006d30d0e5588cb3f68ac5f30a3a99d82379c1aeb |
|
MD5 | ec2b937e8b64d1f55664c262f1615758 |
|
BLAKE2b-256 | b97d9aa9767ced6d5b23091f50c5c09f7d6853b2ce78f1579aa80518966918da |