Coding Challenge #90: Floyd-Steinberg Dithering
In this coding challenge, I attempt to implement the Floyd-Steinberg Dithering algorithm and create a "image stippling" effect on an image (kitten, of course) using Processing. Code: https://thecodingtrain.com/challenges/90-dithering
πΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/-YkMaf9Ea
π₯ Previous video: https://youtu.be/G1EgjgMo48U?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Next video: https://youtu.be/JrRO3OnWs5s?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
π DHALF.txt: https://github.com/SixLabors/ImageSharp/blob/master/src/ImageSharp/Processing/Processors/Dithering/DHALF.TXT
π Processing Tutorial on 2D Arrays: https://processing.org/tutorials/2darray/
π Dither on Wikipedia: https://en.wikipedia.org/wiki/Dither
π FloydβSteinberg dithering on Wikipedia: https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering
Videos:
π My Tutorial on Pixels in Processing: https://youtu.be/EmtU0eloTlE
π My Video on 2D Arrays: https://www.youtube.com/watch?v=OTNpiLUSiB4
π΄ Coding Train Live 114: https://youtu.be/iCxqLVm2H3w?t=8474s
Related Coding Challenges:
π #50 Circle Packing: https://youtu.be/QHEQuoIKgNE
π #85 The Game of Life: https://youtu.be/FWSR_7kZuYg
π #107 Sandpiles: https://youtu.be/diGjw5tghYU
Timestamps:
0:00 Introducing today's topic
1:20 Let's start coding!
2:44 An image is a grid of pixels
3:25 Quantizing an image to reduce the number of possible colors
6:24 Pull the red, green, and blue values of the pixel
7:11 Quantize the r, g, b values
8:21 Add loadPixels() and updatePixels()
9:11 Filter the image to make it greyscale
11:01 Add more color possibilities
13:01 Quantization of the error
16:01 Funnel the error
17:10 Write an index function
21:08 Update r, g, b values
24:13 Deal with the edges
26:55 Conclusion and suggstions for variations
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
π Website: http://thecodingtrain.com/
πΎ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
π© Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
π‘ GitHub: https://github.com/CodingTrain
π¬ Discord: https://discord.gg/hPuGy2g
π Membership: http://youtube.com/thecodingtrain/join
π Store: https://standard.tv/codingtrain
ποΈ Twitter: https://twitter.com/thecodingtrain
πΈ Instagram: https://www.instagram.com/the.coding.train/
π₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π p5.js: https://p5js.org
π p5.js Web Editor: https://editor.p5js.org/
π Processing: https://processing.org
π Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#dithering #stippling #floydsteinbergdithering #processing