Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pseudomanifold/pixsort

Feature-driven pixel sorting in images
https://github.com/pseudomanifold/pixsort

image-processing pillow pixel-art pixel-sorting python

Last synced: 20 days ago
JSON representation

Feature-driven pixel sorting in images

Awesome Lists containing this project

README

        

Pixsort: An artistic pixel sorting program
==========================================

The purpose of this script is to perform a “pixel sorting”
effect that purposefully perturbs an image in order to pretend that it
was damaged.

A simple sorting algorithm is used at present: after sharpening the
images, edges are detected and pixels are being sorted from the edge
with highest intensity (for every row of the image). This is not
the most sophisticated algorithm yet but it already yields some
interesting results.

Usage
-----

Use `-f` to indicate the fraction of all rows of the image that should
be sorted. To glitch all rows, use `1.0`:

$ ./pixsort.py -f 1.0 Images/Lena_small.jpg

If not specified differently with `-o`, the new image will be the
basename of the old image with plus `_sorted`. For this example,
the file name will be `Lena_small_sorted.jpg`. See below for the
results.

Examples
--------

Lena (original)
Lena (original)

Lena (sorted)
Lena (sorted)

Requirements
------------

- `PIL`

Future extensions
-----------------

- Permit sorting of columns as well
- Handle RGB images
- More algorithms for glitching an image