Skip to main content

Pixel Art Scaling - Scale2x and Scale3x

Overview

Scale2x (aka AdvMAME2x) algorithm was developed by Andrea Mazzoleni for sole purpose of scaling up small graphics like icons and game sprites.

However, apparently it appeared to be useful for scaling up grey text scans with low resolution before OCR, to improve OCR quality.

For this, current general purpose pure Python implementation of Scale2x and Scale3x was developed. Current implementation does not use any import, including third party one, and is quite cross-platform and onmicompatible.

For examples of practical programs utilizing this module, with GUI, multiprocessing etc., please visit ScaleNx at Github. PNG support in these programs is based on PyPNG, and PPM and PGM support - on PyPNM, both of which are pure Python modules as well.

Installation

pip install ScaleNx, then from scalenx import scale2x or from scalenx import scale3x.

Usage

scaled_image = scale2x(source_image)

where both images are of 3D nested list (image) of lists (rows) of lists (pixels) of int (channel values) type.

Current Python implementation was written by Ilya Razmanov and may be freely used, copied and improved. In case of making substantial improvements it's almost obligatory to share your work with the developer and lesser species.

ScaleNx at Github

PyPNM - PPM and PGM reading right to list structure used by ScaleNx, and writing PPM and PGM files from similar lists. Makes it extremely easy to write PNM resizer yourself with just a couple of lines.

Metadata

Release files for ScaleNx 2024.11.24.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ScaleNx 2024.11.24.post1
File Size Uploaded Provenance Actions
scalenx-2024.11.24.post1.tar.gz 4.7 kB Without provenance Details for scalenx-2024.11.24.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ScaleNx 2024.11.24.post1
File Interpreter ABI Platform Actions
ScaleNx-2024.11.24.post1-py3-none-any.whl Python 3 none any Details for ScaleNx-2024.11.24.post1-py3-none-any.whl

Total release size: 10.0 kB

Release files / scalenx-2024.11.24.post1.tar.gz

Download URL scalenx-2024.11.24.post1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
50f1139622db212c98a84fcdb14a802255662e93f34fdfc3a8d9ae1a5469e3d8
BLAKE2b-256 checksum
How to use checksums
4e04bbf4a8f27df2d83efe9a506ede77e4f5665bb4a128e0dd19a7cb9548705d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / ScaleNx-2024.11.24.post1-py3-none-any.whl

Download URL ScaleNx-2024.11.24.post1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
568de63ce9bc029fbc161ce9be8b2ae050bebbf402f9883f0439825480d3d490
BLAKE2b-256 checksum
How to use checksums
19e44f2625e8730661cf3ec0dcfaee5b26177d9bb5b0b135e5e4f8c4adac8487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Security for ScaleNx 2024.11.24.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page