Skip to main content

RePixelator 1.0.1

Converts resized pixel arts to their original resolution using FFT analysis.

demo image

(image from https://coub.com/view/4jwv7)

The program finds the most dominant frequency in the X and Y direction, which is the original pixel resolution of the image.
Edge pixel offset is corrected using phase data of FFT output.

Works best with landscape images.
Up to x50 zoomed image, down to 4x4 converted image size is supported.

Install

Python >= 3.5 is required.

pip install repixelator
pip install wxpython>=4.0.0 (for GUI, optional. Read GUI section for details)

CLI

repixelator in_file out_file [mul [nr_sigma [edge_thr]]]

The arguments are purely positional.

GUI

GUI requires wxpython phoenix(>=4.0.0).
Type repixelator-gui in the command line to launch the GUI.

GUI image

On Linux it's best to find pre-built wheel for wxpython.
The wheel build takes about 1-2 hours and it also might fail in the process if you're unlucky.
This is actually the primary reason why I made wxpython dependency to optional, I didn't want to give headache to someone.

For building wxpython wheel on Linux, you might have to install these packages first. (Tested with Linux Mint 20) sudo apt install make gcc libgtk-3-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev

Python API

  • OpenCV BGR image -> OpenCV BGR image
    rePixelate(img: np.ndarray, mul=4, nr_sigma=0.0, edge_threshold=1.0) -> (bool, np.ndarray)

  • File -> File
    rePixelateFile(in_file: str, out_file: str, mul='4', nr_sigma='0.0', edge_threshold='1.0') -> bool

bool tells if the conversion was successful or not.

Parameters

  • mul (int)
    Image pre zoom multiplier, used to spread out generated derivative edges.
    If you clearly see the pixels are huge enough (>5px), you can decrease this value to save resources.

  • nr_sigma (float)
    Noise reduction (Gaussian blur) sigma value.
    This option is not suitable for most images, only use with problematic noisy images.
    On GUI, the slider value is halved for convenience.

  • edge_threshold (float)
    If the image has cropped pixels on the edge, the program will offset the whole image to remove the more thin side.
    If the offset value is greater than this value, the edge will be included by expanding the edge with the image.
    Too small edge threshold will create "dirty edges", because there is not enough information to recreate the edge.
    Note that the offset value is not very stable, so setting low value is not good in general.

Dependencies

opencv-python
numpy
wxpython>=4.0.0 (optional)

Changelog

1.0.1

  • "Current directory" option now saves to the path where the command was typed.

Release files for repixelator 1.0.1

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

Source distribution (sdist)

Source distribution for repixelator 1.0.1
File Size Uploaded
repixelator-1.0.1.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for repixelator 1.0.1
File Interpreter ABI Platform
repixelator-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.0 kB

Release files / repixelator-1.0.1.tar.gz

Download URL repixelator-1.0.1.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a0d76e9849662ae276a201aed1d52886f014fa1df84aa0871a4b6d76d5caf782
BLAKE2b-256 checksum
How to use checksums
640c04151b83b0790cc09120a1280904074f51556b75cbd32dc9449a5ec4ca8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / repixelator-1.0.1-py3-none-any.whl

Download URL repixelator-1.0.1-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b2147d606d107a19906cd69d5ab281ac595cebb3914ba6ab359bf670f76fb53
BLAKE2b-256 checksum
How to use checksums
45297625e79097ea1c4e368d38e51c5071107d9f6a8dce88204b1caa057c5bd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

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