Coding Fun Java Coding Challenge #47: Pixel Sorting in Processing

Coding Challenge #47: Pixel Sorting in Processing

In this Coding Challenge, I implement “Pixel Sorting” in Processing (Java). Using a “selection sort” algorithm, I sort the pixels of an image by brightness and hue.

Sorting algorithms visualized:

Support this channel on Patreon:

Send me your questions and coding challenges!:


Source Code for the all Video Lessons:…

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

46 thoughts on “Coding Challenge #47: Pixel Sorting in Processing”

  1. It is that way to make glitch effects?
    He should do a video about it.

  2. Whoever calling him cringy go and try to find a better and energetic teacher than him.

    I hope you get cancer

  3. My favourite flower is corpse flower

  4. I’m from KS, so I love sunflowers! ?

  5. Olivia Curry says:

    Is the pde file still available?

  6. Català HD says:

    19:47 ArrayIndexOutOfBoundsException

  7. 12:18 now is it black and blue, or white and gold? ??‍♂️

  8. Vin Crafter says:

    pls do more cringey stuff
    youre funny lol
    i subbed

  9. Try sorting by saturation

  10. Don't about a "processing", but can't you just specify a comparator function ?

  11. This is what we call failure.

  12. I don't understand anything of this.. Love your enthousiasm though 🙂

  13. Banty Nagar says:

    Before viDeo ads make my heart cry. Modi sarkar

  14. Pig_catapult says:

    Blue roses, for achieving the impossible.

  15. Matty L says:

    "why is this so slow?"


  16. I love these videos and I love Processing/p5.js

  17. MineCrack says:

    thanks bro u da real mvp

  18. *uses an O(n²) sort*
    “Why is this so slow?”

  19. Your video inspired me to start this instagram page:

    Would be cool if you had a look at it! 🙂

  20. mina rashad says:


  21. Mikey says:

    how does the sorter know that its the brightest pixel if it cant look further down the line? or does it look at all the remaining pixels every time before deciding which one is brightest?

  22. 19:46 You should release a bloopers video ?

  23. i also love sunflowers 🙂

  24. Excellent sir and use simple English

  25. KeinMichi says:

    So you just do a shell sort?

  26. Sean L. says:

    My favorite flower is orange jewelweed.

  27. Scarrax01 says:

    Your Problem is not the frame rate, but the sorting algorithm.

  28. Alex Clarke says:

    Radix Sort
    Very Fast.

  29. RFlintstone says:

    Make it a snake game – all pixels you travel on will be sorted.

    Your goal: render all pixels as soon as possible.

  30. P H says:

    I love maracuja/passion flower.

  31. also the green carnation is my favourite flower

  32. 5-MeO-DMT says:

    Why Selection Sort??? Why not Counting Sort???

  33. It’s n log n algo. For every pixel you look n – i pixels.

  34. Thats cool,

    May PHP do same thing like that?

  35. hero32 omega says:

    I dare you to waer a green shirt

  36. Pixel sorting song remix, where is it?

  37. Mike Hunt says:


    Jk your passion is amazing, keep it up!!

  38. Matej Petras says:

    I really like sunflowers and I love cats

  39. Why didn't you do a faster sort? And you should have sorted by pixel value. So it would have come out reverse rainbow color. Neat video. A great still to emulate

  40. How can I get binary image using threshold selection concept
    after converting rgb to greyscale..
    is it required to read pixel values of greyscale if so how an I do it Java plss help.

  41. Zeger de Vos says:

    I just get a grey sketch screen when running the non-animated code. Also when I copy and run the code from Github. I don't get error messages, just a grey screen.

Leave a Reply

Your email address will not be published. Required fields are marked *