Message Boards Message Boards


Pixel sorting according to different methods

Posted 8 years ago
1 Reply
4 Total Likes

Inspired by a tweet from Wolfram Research and their link to this, I made this Manipulate. Hopefully it will inspire others to do better?

 Image[RotateLeft[#, t] & /@ 
   RotateLeft[SortBy[ImageData[im], fun[#[[All, c]]] &], s]],
 {{fun, First, "function applied"}, {First, Last, Mean, Median, Norm, 
   Normalize, StandardDeviation, Total, Accumulate, 
   Flatten@Gather[#] &, Sort, Commonest, Differences, 
   TrimmedMean[#, .35] & -> "trimmedMean", 
   TakeLargest[#, 1] & -> "takelargest", Nearest[#, {0, 0, .5}] &}, 
 {{c, 1, "color"}, {1 -> "red", 2 -> "green", 3 -> "blue"}, SetterBar},
 {{s, 0, "shift up-down"}, -200, 200, 1},
 {{t, 0, "shift right-left"}, -200, 200, 1}]

The original pic is here One result of pixel sort is here

enter image description here

POSTED BY: Erik Mahieu

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract