sortpixels

command module
v0.0.0-...-21f7faa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

README

sortpixels

Sort and rearrange the pixels in an image.

The algorithm

  1. Take each column of an image and sort those pixels vertically by brightness.
  2. Take each row and sort the pixels horizontally by hue.

Repeat these two steps until the image converges on a stable arrangement of pixels. You'll get an abstract version of the original image using the exact same pixels, but clumped together into areas of similar color.

This was first implemented with in-browser Javascript as The Image Pixel Sorter. This version is written in Go and is much faster.

There is also a blog of sorted images.

Usage

sort-pixels input1.png [input2.jpg input3.png ...]

The resulting sorted images will be written into the ./output subfolder (which is created if needed). Images which are already in the output folder will be skipped.

Warning: very large images (e.g. 2000 x 4000 pixels) can use 500 MB of memory during sorting.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL