
The sorting can be controlled by mouse movements over the image or put in autoloop, where it will use all the sorting direction and sorting methods (hue or brightness) for each cycle. It chooses how the line is sorted, the direction of sorting and how much of the line must be sorted using quicksort lower and higher indexes parameter variables.
Pixel Radix LSD (least significant digit) SortingĬontrolled Pixel Sorting by each horizontal lineĮach line is individually sorted using quicksort. Stable: No (I know there are stable versions, but not this one) This is evident on the images on the bottom of the page. We can actually see the differences between a stable sorting and an unstable just by see the pixels arrangement. Stable sort algorithms sort repeated elements in the same order that they appear in the input. It also mentions if that sorting method is stable or not. For each frame, the process will run a multiStep times.īellow there are the links of video examples for each visualizations method (GIF images were too big to put here). This is used to control speed of sorting process.
int multiStep -> each sorter has its own value. As the name sugests the user can select how to sort the pixels by hue or brightness String sortPixelMethod -> can be either "hue" or "brightness". If the image is bigger than the device's screen, it will rescale the image to 80% of the screen. boolean showBothIMG -> can be either "true" or "false" If true, it shows both imgs side by side, otherwise it only shows the sorted img with the original image in the corner reduced to 20% the size. Each have their own option variables and they are at the start of the sketch. Most of the processing sketches have the following variables to control the visualization and sorting. Imagination, time and knowledge are the only restriction.
In fact, there are a lot of crazy ways to sort pixels.
you can sort just like above and with any sorting method, but instead of sorting all the pixels of the images, it can be done by sorting line by line separated, either horizontally or vertically or a combination of those, just a section of the image. So far I only did for hue and brightness. you can sort by hue, brightness, by the colour channel, saturation (HSB colour mode). Since we are talking about sorting pixels, there are lots of ways in doing that: Those sketches with "Simple" on its name are the 1st attempt to understand the pixel sorting process and don't have or have limited visualization. This is my attempt to learn those sorting algorithm, but with something aesthetically pleasing. A set of pixel sorting visualization using different methods on Processing v3.