3 ms·
This gave me an idea for reorganizing it. I want to do a kind of bubble sort on the pixels and see what it looks like. To be specific, let's say we take two p
by perl4ever 5y ago
This gave me an idea for reorganizing it.
I want to do a kind of bubble sort on the pixels and see what it looks like.
To be specific, let's say we take two pixels at random and compare each to their 8 neighbors. If they are closer to the surrounding pixels when swapped, then swap them. Repeat.
I may try this, but I'm lazy, so in case someone else wants to...
- heyitsguay 5y agoI actually just did try it! I'm finding that random pixels don't really get swapped. Except along comparatively uncommon borders between squares, pixels are already very similar to their immediate neighbors. Creating a video with 10000 swaps per frame, I found no successful swaps in 50 frames. That said, I bet there's some other criterion that would have the desired effect.
- zamadatix 5y agoI don't think this has a stable "end" it can reach. Diagonals of pixels of the same x,y coordinates in linearly adjacent (green incrementation) cells would trigger a swap as the diagonal is +-1 in both the red and blue channel but the same pixel offset in a different cell is +-1 only in the green channel. I can't think of any 2d arrangement where the difference of a pixel in a cell to all 8 of it's neighbors could be 1 for every pixel so this "sort" would really just cycle pixels around based on the order your random number generator happens to pick swappable diagonals by chance. As such it'd never converge and look like slowly adding distance capped noise over time. The seams between cells would only seek to increase the cap on this noise from 2 to 255. 255 being the minimal maximum distance I can imagine for a sorted grid of 2d pixels (i.e. I think this image is a min-max optimal ordering). It'd also take a ridiculous number of iterations to really notice the noise being added. Perhaps unfeasibly many if you're wanting to go deep and truly rely on random comparisons.
- OscarCunningham 5y agoThe process would have to stop eventually, because each swap reduces the sum over all pixels of the distances to adjacent pixels, and there is no infinite descending sequence of positive whole numbers.
- OscarCunningham 5y agoThat's similar to the process used to generate https://allrgb.com/order-from-chaos https://allrgb.com/order-from-chaos except that the pixels used in that algorithm weren't chosen entirely at random, and they sometimes randomly allow a swap even when it increases the difference, in order to escape from local optima ('simulated annealing').