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 Distribution
Built Distributions
Hashes for xbrz.py-1.0.2-pp37-pypy37_pp73-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63ebc7ca919822c0cd9032512064aa31c6cdbcce0c9eea85e15bd445bf2d160 |
|
MD5 | eb5d94a167b692be200fccf34a815a1e |
|
BLAKE2b-256 | 4439ea9d2c3699ae3066e1b7aed07bc73588e29c6c5d930fd841a77e3e972b54 |
Hashes for xbrz.py-1.0.2-pp37-pypy37_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9599f8b45a09d8c933a3332a37dd3cf8f2ea69128c520a3fc389d57601b1d7df |
|
MD5 | 4775bf15aa3e242d9d7b6e0f167b59df |
|
BLAKE2b-256 | 7c29f90552aa9e798a3fd9038f159aae2b7aa4358d8ac285670129805d89c14b |
Hashes for xbrz.py-1.0.2-pp37-pypy37_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d3ceb6b1662601faffe8b74514b0a7bc3a1684dd2f18f27dc3e3027e1e6ada7 |
|
MD5 | b5cd9489d22937cd93d8c9d5ddfa7aa4 |
|
BLAKE2b-256 | 21c8af2710318441c3618495aae1a3823c25bab021354a9cf96fd4800e9164e7 |
Hashes for xbrz.py-1.0.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af543bc43362605c14e13ac79b7527d4a2436660b5fedb718ebfef34cd109b1f |
|
MD5 | f4144b7a894387c17433bb64d7ef3527 |
|
BLAKE2b-256 | ac3cae1d1c5ec99528433fb131cec7e9cfb3dfbd52de475a3c9bb3ddd2499079 |
Hashes for xbrz.py-1.0.2-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 753cebf1c16b64ae522c21aecca929dc6ea4a884ff830f897bb0391fc7ddcb98 |
|
MD5 | af946baecc2d88b364fc985573fe5e1f |
|
BLAKE2b-256 | cc70a0d956094e92a06deeca4a7e7227709d352e598bcdbde983c05c71586b47 |
Hashes for xbrz.py-1.0.2-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2911ce537c9917ba694fdf592c1d26165b912c7282f02c3f163a34894b30a730 |
|
MD5 | 39de57e3c6448309a77dd875c618de19 |
|
BLAKE2b-256 | 25f62f27d9c2d14c7dac75094862e8977add11a4e448337ad08c11913016cae3 |
Hashes for xbrz.py-1.0.2-pp36-pypy36_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcd8884b726fbabbf8ffd01ac2b055e84a7c43e38599f372993617a7abfbf218 |
|
MD5 | ad4c9df781777bbfd6892158d8b2513e |
|
BLAKE2b-256 | fdf4a2173d9f16fce03ae6219abcbec617281a24180e32535ff98e201baf462d |
Hashes for xbrz.py-1.0.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3f8cd1ebc549435c2205181562ef18a721fab7fcb29ea77d58afef72d2c2eb2 |
|
MD5 | 95809a3e172f2c9cc74f57a55a873b43 |
|
BLAKE2b-256 | c25c171f8f7ca982eb67f835e86c6dae6aca5d361e5656a0e45398fbe76cdc32 |
Hashes for xbrz.py-1.0.2-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b8718461780f1f97ad7faad973a0b5c5896de6226fee30dee5cf1e6db210bca |
|
MD5 | 258d6978b04074a93ebf9c0f5e1995b0 |
|
BLAKE2b-256 | 2fc559b8d44779e131615020b2aaa75b8e4b3bd4180324cd6cc3e0c5b4f274df |
Hashes for xbrz.py-1.0.2-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a220a3338bb9540304726fb359b93d2fa63112c1c55849817cfe13ea87503c03 |
|
MD5 | a5d33f3fe912f637184541a408852a7c |
|
BLAKE2b-256 | 41cd31ed5a21c11143eb15f9fb14e38a0f9dd404570e1b2052b5c08d346bab21 |
Hashes for xbrz.py-1.0.2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c070997d188140d3a215eb476839c75b43f97320c6c0858f43e0773325ec7eed |
|
MD5 | ee3754c747457c2b2c4d21983a26e163 |
|
BLAKE2b-256 | 2450fda0bd9c7545ebd7fcf1047a6993f698f38d33c93cae1410493f487ed54f |
Hashes for xbrz.py-1.0.2-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd0affeadba312bcc367b21bbc85847f224f592d00ff812c1ab42872b5be5091 |
|
MD5 | b726422fe05ec88331e484148148c14e |
|
BLAKE2b-256 | 6d29adc1301b39e3d52321303b2ab3ca2f95eb618f4bae7a217245c016783dbf |
Hashes for xbrz.py-1.0.2-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b02b9ba412be6909e442cd391fa02d9569140c977bdbaf92d569b2d2ec16f2d |
|
MD5 | a7d3cdb3b733c97d7cdd3d095113b1b6 |
|
BLAKE2b-256 | 84f4b9411b6711dc138520cca9359dab14630c29e2cfa1905c22ac3c0f706599 |
Hashes for xbrz.py-1.0.2-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ebaa8991fde5e7597efb083388e22bc7d59da5213c75eaa9d2ee004289a4196 |
|
MD5 | 4b85caec213bd184c63a4276213f4aa5 |
|
BLAKE2b-256 | 8ea946a2cc40652c6078766fcb712cb9f8b4b04ecedb39691bff1a6d597ad2c0 |
Hashes for xbrz.py-1.0.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0408e3890100cba6112d7cd84ed5d1ada7519ee2e44ab39dc116949e6196039 |
|
MD5 | 5ddf8bb29b6d64093d6ead7c29925a65 |
|
BLAKE2b-256 | 6dc70dda9695263e32ca724cbb99b9e528369f2513c93761f5ab414ee3d74835 |
Hashes for xbrz.py-1.0.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc9e91041d689f9e8f0c25b14ba15dcc93c0a7e2738d58abfe4fc23d6e89c779 |
|
MD5 | 987339d06313053090f11df06be04345 |
|
BLAKE2b-256 | 71fba97980d32059e4a3d8969699782a757dd468ba253bcd7d1c12714097c482 |
Hashes for xbrz.py-1.0.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9882ed76c419ea91e19c9b9651d08801cfe45e8f9849c59874d7af3424fd1673 |
|
MD5 | 26fd3bfa8fe7f1db284dee0436d54f19 |
|
BLAKE2b-256 | 8a038775c85da0234bf065661798d52fb7fd187ed99476f295d0e0f82dda1410 |
Hashes for xbrz.py-1.0.2-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23ad3a35f3fef53770e79f3d2c784e485b6a7c77b1e1048fe0846084b3c557be |
|
MD5 | 947ba45bd61ae14b7ef51fb61308d991 |
|
BLAKE2b-256 | ff5e44d01901b66053ab0a891c42d351b18aec7d1ba7028ea3604030e87d6029 |
Hashes for xbrz.py-1.0.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 683d3ab3da32ca5cb04a12a54350ee1606e5a707f30db974d4489d2ddbbcf2e2 |
|
MD5 | b7d810054afd74583be8385a6952deeb |
|
BLAKE2b-256 | ac180621444a48403e950ce83ba81a77bb8c620c73224f59735cadae210d974b |
Hashes for xbrz.py-1.0.2-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f4a24aefd0119f8d3998283487363d5181383f454e37865df1bd5c25cf85666 |
|
MD5 | 70f8f0d84a244f54ee4212703e4085d7 |
|
BLAKE2b-256 | efdbfe172d4c248a124f2db61c821c10d75ca0023d46d554c3734a585e488512 |
Hashes for xbrz.py-1.0.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff9c6b73c8e2450e0ef23332be032bc7b963aa3eeda6567ccc15b3f7bf3ac824 |
|
MD5 | cbaee2ba1d4560d945820bf059bdaf50 |
|
BLAKE2b-256 | 4a2351e243505cc5cde7fc876c467c51d6794e3defaec4b09fc6efe664d7a513 |
Hashes for xbrz.py-1.0.2-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dcca6e98b11ebbeb6147614e217fd447f27fb140cd70f8a651c2b89cb37d367 |
|
MD5 | 998142a6ce11abca5915eeb61c2d47c6 |
|
BLAKE2b-256 | b3b68dcc60d482401535ce7987e09ccd682fe78070c13fe17439dd1978e7a2dd |
Hashes for xbrz.py-1.0.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dcb195fcf119c435e10b897e13270c97f0a063883c0b10db971657f0d2033fa |
|
MD5 | 17917a00d65b4d7f9cb197c1c5314e83 |
|
BLAKE2b-256 | 4bb9d3279de2a800a380b06fea868222ea234a439949591c19ef978ed0337166 |
Hashes for xbrz.py-1.0.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f32870e382604e5243a3275d3eed70f14bb2eb0317863db6b2d1e925fa8142bc |
|
MD5 | 639bcd5e696cfcd2d7d279688f40c49c |
|
BLAKE2b-256 | 1762ab9050b744d1cadbd99f51e654050110655faa5e07c2fa6845a6c2509f00 |
Hashes for xbrz.py-1.0.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db1e672d203e5be6a055d40e38f1a3040be1f60c723a1d7123f0ff385a57d5d3 |
|
MD5 | c9ef0477df0e31292f37fccfc54e4393 |
|
BLAKE2b-256 | e0f4cf878ea7c9e59b47d14e000acf69b1ada37093c02d91a5b4b354c5e1d9c4 |
Hashes for xbrz.py-1.0.2-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ab0abdbbba618716647051b0e75821c7457e9a5617ca7f7a9b1075237647cd3 |
|
MD5 | 9dd8efb56cbef86b78460a3e053f1176 |
|
BLAKE2b-256 | d31263c9cea1654f96fc306afe2496649d2b8313b52880ef58765728dcead213 |
Hashes for xbrz.py-1.0.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0706920f6e1c414a82b779744e98e39e9ce56170f2894b2d8252068b31a45eb2 |
|
MD5 | 2b27f162a9b9127f6faab2946753d454 |
|
BLAKE2b-256 | 0d9732e495b0dc89882a8ae616e4b3e46d0af638e2958ccc316878fd15b62494 |
Hashes for xbrz.py-1.0.2-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a54fcabf8a6ba4eb2f076bb14396b05cb6f8097479cc232a491e305e5f6fb106 |
|
MD5 | d6c2cd12a527c3d443bf2ee6c4485cb4 |
|
BLAKE2b-256 | 02325f15aaec60ce2735d9272eced50ea79cbae5b01a8e85c8250c434d20af60 |
Hashes for xbrz.py-1.0.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b039da4ce43df0c0cde61e0191ea6df4b6300d0e565cd6189c27c5e0dbac8282 |
|
MD5 | 6f9e69b8b100d3545dfb18ba62cf6915 |
|
BLAKE2b-256 | 4cff4583c4b72388a86f83d9ba866474f35515a326879ad7ad5e3e8141f549e7 |
Hashes for xbrz.py-1.0.2-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3b1fbca09c60b826aca4e25e55c8befd4dab3476d3ea0c2ff5dad21b1c8fd23 |
|
MD5 | 971aaa8b6943b7cab59708eed517c1ca |
|
BLAKE2b-256 | 79bb57a582017fe5a99a0e0dffbc978b3e22647ffb672dafa1cadd2d591dc602 |
Hashes for xbrz.py-1.0.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a61a0b948984405dad4092d1a06ab69f8eab74fd11c5e323ce6489b8b50d2e63 |
|
MD5 | bc4e566064f3781fb2a3c96aee320946 |
|
BLAKE2b-256 | 6dbfa7dcd281774794fe618ceb2620e0d15a2bef262f1840b4753df047594258 |
Hashes for xbrz.py-1.0.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95fbc248d3406ed6b75e3df5fc505a508e36c552ad4a2fa9a110291953b136d7 |
|
MD5 | 8875d851bcc9a14e40580c72e9752160 |
|
BLAKE2b-256 | 3e9d4903ea9f95e63db0214cb4efd7c3d3359e2869a653913692dbc2f231c27d |
Hashes for xbrz.py-1.0.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c33beb209d5ffffd66c60568a74713470900045ee3ad4cc4766c8da8914a551 |
|
MD5 | 159194882fe62a13927013e3b53abdb3 |
|
BLAKE2b-256 | cac84b1975f6438dceed87b8fb850321e7429373575dffca8bc72e39f293f05c |
Hashes for xbrz.py-1.0.2-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a92e57bf1f61ccb272438504c5ea87fadbe298fc716eed745674b9e557bd817f |
|
MD5 | f298f7418be4bccef27963ef683f5a61 |
|
BLAKE2b-256 | 73a9af553bca8a58046b886eb03f902a501202d74a248d9da89662820bb43519 |
Hashes for xbrz.py-1.0.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b5fb334f235abb7b76cfb884a556af0d924f78fe6c5461fd06fb75753ded165 |
|
MD5 | cc2ea4c7c3907ae062e6d4d2369ac708 |
|
BLAKE2b-256 | c79a321a186e153e46d46e1f5dd9dfe03c59105e94180a7e4f960b3eb8a452ce |
Hashes for xbrz.py-1.0.2-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 685d4642c3a97c736d9cbcbbd7ed242d56431f7cbca68408aad263e36047c70e |
|
MD5 | 64d3c3b3be8f3b4b34cbce4fc97672a3 |
|
BLAKE2b-256 | 4360c8b6c087eb4cbc350521eb54d0d452e4af4c165fc27469f29da7e6e16c94 |
Hashes for xbrz.py-1.0.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de3c8bdad9ad19e57388a58d59fb5b272d43a97b55d01758ad8621a7ce27469a |
|
MD5 | 778e1039971368cd40e5d49dbb7f399e |
|
BLAKE2b-256 | a0d050296db40de99d895c0627fbf8aa85787654ae0a883390ee1c48a51e5ca5 |
Hashes for xbrz.py-1.0.2-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8a32a128773d6759f9a686a7d8b10bfe1e45491bf4a37bba0d38454f91f9567 |
|
MD5 | 68ebd0d9aa78a267522ce7a03288984d |
|
BLAKE2b-256 | 70a92f96784fc914496c9cc5a39663a0e600a9a0d5f0935da55cc152dfec5c29 |
Hashes for xbrz.py-1.0.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b1fc93c5f4f5e6dcdd4461f5351ae186446ec8ca3c57f643a042ed56ad304b1 |
|
MD5 | bd5312820d70ac998cb897d1a639dc6b |
|
BLAKE2b-256 | c965821cafd69a8bd49d6c1373b942345420e09a3f0e4066084de8321468b087 |