Skip to main content

A high-quality image upscaling package using a genetically-evolved algorithm.

Project description

SHINKO 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 the required dependencies:

pip install numpy pillow scikit-image scipy

Basic Usage

from evolved_upscaler import evolved_upscale

# Upscale an image from file and save the result
result = evolved_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 = evolved_upscale(arr, scale=2, output_type="PIL")

# Upscale and get a NumPy array
result = evolved_upscale("input.jpg", scale=2, output_type="np")

Command-Line Example

A minimal test script is provided:

# test_evolved_upscaler.py
from evolved_upscaler import evolved_upscale

evolved_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 evolved_upscaler.py for efficient, non-ML upscaling.

License

This project is provided as-is for research and educational purposes.

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

shinka-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shinka-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file shinka-0.1.0.tar.gz.

File metadata

  • Download URL: shinka-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.17

File hashes

Hashes for shinka-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7538dbd8b808fb2c8132baefe04b984c2595ca98fc184e86414a3515f7e51228
MD5 66a969c49bcaa6c01f472ad3a76b5f71
BLAKE2b-256 36a4e14c8199e61672d276b32cfa894b864fdbe086788235386b09a6b714fafa

See more details on using hashes here.

File details

Details for the file shinka-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shinka-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.17

File hashes

Hashes for shinka-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d69aeb358f6e6832f3fbcfce271d9482770948eaca1f7c6a161a886dadfc610
MD5 8c68b39d6a5e9b026c616a1b7e90fdd9
BLAKE2b-256 5caae481020c8de27101aff0a519d3a7815f4ec1fe482c237f757fb2a77d8a74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page