I’ve continued with my pixel sorting experiments. I’ve made one change to the script as well as one addition. The change is that the pixel sorting algorithm no longer wraps, so only pixels in the same row can be swapped with one another. Pixels can be shifted side to side but never move up or down. This constraint goes one step towards preserving more of the original image. The addition is a condition that must be met before two pixels are swapped. For example, a pixel will be swapped with the next pixel if it has a higher saturation value, but only if the next pixel has a red hue. This is where things really get interesting. There are a lot of permutations of this logic and the results are always a bit of a surprise. You can sort by saturation but ignore dark pixels. Sort by brightness but only move blue pixels. Every combination of parameters and thresholds (how blue is “blue”?) provides a different result. Here are a few of my favorites so far.