A high-quality image upscaling package using a genetically-evolved algorithm.
Project description
SHINKA Upscaler
This repository provides a Python API for high-quality image upscaling using a specialized, genetically-evolved algorithm. The upscaler is designed for both grayscale and color images, and can be used as a drop-in replacement for traditional interpolation-based upscaling methods.
Features
- Upscales images by a specified factor (e.g., 2x, 4x)
- Supports input as file path, PIL Image, or NumPy array
- Outputs as PIL Image or NumPy array
- Optionally saves the upscaled image to disk
How to Use
Installation
Install from PyPI:
pip install shinka
Basic Usage
from shinka import upscale
# Upscale an image from file and save the result
result = upscale("input.jpg", scale=2, save_path="upscaled.png")
# Upscale a NumPy array and get a PIL Image
import numpy as np
from PIL import Image
arr = np.array(Image.open("input.jpg"))
result = upscale(arr, scale=2, output_type="PIL")
# Upscale and get a NumPy array
result = upscale("input.jpg", scale=2, output_type="np")
Command-Line Example
A minimal test script is provided:
# test_shinka.py
from shinka import upscale
upscale("DSC00183.jpeg", scale=4, save_path="test_evolved_upscaled.png")
print("Saved test_evolved_upscaled.png")
How the Algorithm Was Created
The upscaling algorithm was developed using a genetic optimization process. A population of image processing pipelines was evolved over multiple generations to maximize perceptual quality (measured by SSIM and sharpness) on a diverse set of images. The best-performing pipeline was selected and implemented in shinka for efficient, non-ML upscaling.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shinka-0.1.1.tar.gz.
File metadata
- Download URL: shinka-0.1.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b813c3eba654751b97d016cd6fdff15eb4384cdc6c9b7ecd7dca633b5afab8e7
|
|
| MD5 |
b0a92ed1c17d098784cf63cf3302c3be
|
|
| BLAKE2b-256 |
8e590aeea9ff479c9cf5704787ef62f06929f349ec339808896152dfeb1a253f
|
File details
Details for the file shinka-0.1.1-py3-none-any.whl.
File metadata
- Download URL: shinka-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7aad2e5d9735d1b81f829360cefb961618706e93303c5076f07f544da094e7b3
|
|
| MD5 |
ca8f11a93fa0fbd914a7e93d1d1997be
|
|
| BLAKE2b-256 |
c6525a87bac96cf852493663f8ba1d3e865e82c1858c15c89910c501ae850e07
|