Skip to content

thorlarholm/jQueryImageMask

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jQuery ImageMask plugin

ImageMask makes it possible to get Flash like image compression with alpha/transparency and small file sizes.

How it works

By adding a "data-mask" attribute to an img tag with a reference to an image that contains the mask will mask the src image.

\

Then run the plugin:

$(document).ready(function () { $(".container").imageMask(); });

and it will find all images with a data-mask attribute in the image container.

It combines the two images using canvas and replaces the original image with the generated one.

Example

Example Image

Is it worth it?

It requires a bit more work because one has to save two images. It also helps to have a solid background on the original image for better compression. There may be circumstances where a normal png with transparency is preffered, but with larger photos it does have a considerable effect.

Credits

ImageMask author (Per Sommer)

jQuery

About

Jquery ImageMask plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors