Mask JPEG with HTML5 Canvas Browser : Chrome23+ (Win/Mac) Firefox14+ (Win/Mac) Opera12+ (Win/Mac) Safari6+(Mac) IE9+(Win) IE8(Win) If you can understand japanese, see also my blog post.
You need 3 images.
- JPEG image image.jpg
- Mask iamge (gray scale PNG) image_mask.png
- PNG image (for IE8) image.png
<img src="image.jpeg" class="maskJpeg" />
$(function(){
$('img.maskJpeg').mgJpegmask();
});
If you want to change mask image suffix (default "_mask")
$(function(){
$('img.maskJpeg').mgJpegmask('_suffix');
});
Also check psd file in "demo" directory