css - jQuery - How to brighten an image -


hi
in jquery, can use code below, make image darkly. in opposite, how can bright image?

$(this).hover(function() {     $(this).stop().animate({ opacity: 0.5 }, 500); }, function() {     $(this).stop().animate({ opacity: 1.0 }, 500); }); 

i'd use pixastic this. has jquery bindings if want take route.

you can lighten or darken image this:

var img = new image(); img.onload = function() {     pixastic.process(img, "lighten", {amount:0.5}); } document.body.appendchild(img); img.src = "myimage.jpg"; 

you fake effect changing opacity of image, making sure background behind image white.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -