An interesting interactive animation that converts an image into another image using the first image's sampled pixels and a little bit of pixel sorting. Written in Processing. Inspired by the work of Daniel Shiffman.
Note: the animation's resolution was lowered so it could fit on git
original source image -> luma sorted pixels -> destination image with new sampled pixels
Basically, the program maps one image src to another image dst by:
- Scaling them to be similar proportions
- Sampling pixels from each
- Sorting sampled pixels for both by luma. The original screen position of each pixel is stored before the sort.
- Using the sorted index in both as a map between the first image and the second, e.g. sortedImage1[i] is mapped to sortedImage2[i].
- Each sampled pixel is turned into a particle that moves to its new mapped location to create a nifty animation!