p5.js Coding Tutorial | Pixel Sorting @pattvira
p5.js Coding Tutorial | Pixel Sorting  @pattvira
Uploaded May 2025 | Updated November 2026, 20 hours ago
LET'S CONNECT
✨ Sign up for my newsletter at pattvira.com
✨ Instagram: instagram.com/pattvira
✨ Twitter: twitter.com/pattvira
--
Links:
πŸ”— p5.js editor: editor.p5js.org
πŸ”— Pixel Sorting Code: editor.p5js.org/pattvira/sketches/Z7ET7t0s6
πŸ”— Introduction to Creative Coding Playlist: youtube.com/playlist?list=PL0beHPVMklwgMz4Z-mNp4_udo9mjBk7pn&si=XhvQaojd6cIrxvdn

Inspiration:
πŸ”— Kim Asendorf:
- Website: kimasendorf.com & https://teh.kim/
- ASDFPixelSort Code: github.com/kimasendorf/ASDFPixelSort
- COMPLEX exhibition: instagram.com/p/DH74KaOx24M/?hl=en

References:
πŸ”— p5.js loadPixels() function: p5js.org/reference/#/p5.Oscillator
πŸ”— Javascript sort function: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

Timestamps:
0:00 Intro
0:46 Explain pixel sorting logic
1:48 Preload and resize image
4:50 loadPixels() vs p5.Image.loadPixels()
8:41 Explain how to change pixel values using updatePixels()
11:09 Write a function to sort pixels by column
22:50 Change to dark mode (brightness is less than threshold)
23:24 Write a function to sort pixels by row
26:30 Animate the sorting action
p5.js Coding Tutorial | Pixel Sortingp5.js Coding Tutorial | Oscillating Wavesp5.js Coding Tutorial | Interactive Vinyl Cover (Image Masking)Why Technical Literacy is Your Ultimate Defense Against AIp5.js Coding Tutorial | Donut Forget You Are Awesome 🍩 (aka coding DONUTS)p5.js Coding Tutorial |  Interactive Grid with Bouncing BallIntroduction to Shaders: A Beginners Guide (1/4)p5.js Coding Tutorial | String ArtWhat is Object-Oriented Programming (OOP) - Creative Coding with p5.jsp5.js Coding Tutorial | Persistence of Vision Effectp5.js Coding Tutorial | Location-Based Data Visualizationp5.js Coding Tutorial |  Bouncing Ball
Patt Vira |

p5.js Coding Tutorial | Pixel Sorting

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER