Metadata-Version: 2.1
Name: ScaleNx
Version: 2024.11.24.post1
Summary: Image resizing using Scale2x and Scale3x algorithms, in pure Python.
Home-page: https://github.com/Dnyarri/PixelArtScaling
Author: Ilya Razmanov
Author-email: ilyarazmanov@gmail.com
Keywords: scale2x,scale3x,pixel,resize,rescale,image,bitmap,python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: The Unlicense (Unlicense)
Classifier: Operating System :: OS Independent
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE

# Pixel Art Scaling - Scale2x and Scale3x

## Overview

[**Scale2x**](https://github.com/amadvance/scale2x) (aka **AdvMAME2x**) algorithm was developed by [Andrea Mazzoleni](https://www.scale2x.it/) 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](https://github.com/Dnyarri/PixelArtScaling). PNG support in these programs is based on [PyPNG](https://gitlab.com/drj11/pypng), and PPM and PGM support - on [PyPNM](https://pypi.org/project/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.

## Copyright and redistribution

Current Python implementation was written by [Ilya Razmanov](https://dnyarri.github.io/) 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.

## Related links:

[ScaleNx at Github](https://github.com/Dnyarri/PixelArtScaling)

[PyPNM](https://dnyarri.github.io/pypnm.html) - 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.
