Skip to content
loading...

re: The JavaScript Iteration Protocols and How They Fit In VIEW POST

FULL DISCUSSION
 

Hi Ken. This is a remarkable article. Really enjoyed reading it and I learned a lot about iterator and generator usage in js. It's a concept I was aware of but did not use in daily coding yet.

I personally love messing around with image manipulation using the HTML5 Canvas element. You can load up an image using the native Image object, then paint it to the canvas, grab its ImageData object, and directly manipulate pixel values.

So this sounds very interesting! Can you maybe point me to an example of yours where the whole process (loading the image, manipulating it etc.) is visible?

kindly, matthias

 

Just whipped one up real quick, here you go! It adds a bunch of extra blue to each pixel in an image.

I used an expanded version of the generator function in the post that persists changes made to each pixel back to the original ImageData object for easier image manipulation.

 
code of conduct - report abuse