public final ImageData copy ( ) { final Context2D context = new ScratchPad ( getWidth ( ) , getHeight ( ) ) . getContext ( ) ; context . putImageData ( this , 0 , 0 ) ; return context . getImageData ( 0 , 0 , getWidth ( ) , getHeight ( ) ) ; }
ImageData can t be cloned or deep - copied it s an internal data structure and has some CRAZY crap in it this is cheeeeeezy but hey it works and it s portable!!!