A set of experiments in pixel sorting using Processing
- - -
Using either edge-detection or random choice, start with a set of 'seed' pixels, grab all neighbors within a 1px radius, sort those, and repeat the process.
[ example ]
Similar to the 'seam carving' example, this is a little softer movement across the image by looking for least change between the current pixel and its neighbors.
Sees the image as a linear list of pixel values (rather than 2d), sorting in chunks. Includes wrapping for weird distortions and patterns.
[ example ]
Similar to the previous, but sorts the image by blocks.
See this video this video for an example.
Sorts a random column of pixels, then looks for the closest match to the last pixel in that column. Sorts and repeats. Imagined as a kind of "Chutes and Ladders" within the image.
Based on the algorithm used for Photoshop's "Content-Aware Scaling", find the path of "least energy" through the image, starting at the bottom center. That path is sorted, then shifted over 1px and repeated across the entire image. Versions include one phase, as well as rotate-and-iterate for serious pixel-mashing.
[ example ]
The entire image is loaded in order from outer edge in, then sorted and placed back.
[ example ]
- - -
[ all code available under Creative Commons BY-NC-SA license - feel free to use but please let me know ]