I know this is over 1 year old, but as many others i am interested in this topic. Not necessarily for the sake of actual pixel sorting, but for the more general problem of n-dimensional sorting, and color sorting is a nice visual example of this actually since each color is at least 3-dimensional in RGB. Anyway - looking though posts i am intrigued by the idea of a unique negative number that represent “color”, with -1 white and -16777216 black. How do you do the transformation from RGB to this negative number? I read the processing help for color, but i still don’t understand it. This transformation is also interesting because you actually reduce the dimensions from 3 to 1 - it seems.
Thanks for any insight,