Created
October 14, 2010 13:32
-
-
Save jfsiii/626165 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Moved forgeImage and hasSameOrigin to canvasFromImage. Still cleaning up the internal structure, but it works now. | |
* | |
* Killed renderClosePixels and reorganized closePixelate. | |
* | |
* What do you think? | |
*/ | |
function closePixelate( img, renderOptions ) { | |
var onCanvasReady = function ( canvas, image ) { | |
var parent = image.parentNode, | |
ctx = canvas.getContext('2d'); | |
canvas.className = image.className; | |
canvas.id = image.id; | |
// perform the Close pixelations | |
processData( ctx, renderOptions, image.width, image.height ); | |
// add canvas and remove image | |
image.parentNode.replaceChild( canvas, image ); | |
}; | |
canvasFromImage( img, onCanvasReady ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment