November 2011
Intermediate to advanced
348 pages
7h 2m
English
Looking for a fancy way to focus an image? How about a pixelated image focus? In this recipe, we'll explore the art of image pixelation by looping through an algorithm that pixelates an image less and less until it's completely focused.

WARNING: This recipe must be run on a web server due to security constraints with the getImageData() method.
Follow these steps to create a pixilation function that slowly focuses an image:
focusImage() function which de-pixelates an image based on a pixilation value:function focusImage(canvas, context, imageObj, pixelation){ var sourceWidth = imageObj.width; ...Read now
Unlock full access