Needed: Cross-Browser javascript that can pixelate or sufficiently blur an image

Posted on 2003-03-22
Medium Priority
Last Modified: 2008-03-17
Pixelation is preferred. What I also need to do is place a watermark over said pixelated image.

Since carrying blurred versions of each image possibilty would get kinda beefy, I'd like to do it on the fly with JavaScript.

The scenario is that I have a bunch of thumbnails which the user can mouseover, which then displays the image in its original size in another area on the page. But not all images should be available to all users, hence the blurring effect. This should work in Mozilla as well as IE.

Question by:byteslinger
LVL 12

Accepted Solution

lil_puffball earned 1000 total points
ID: 8188274
Here's a script. Not sure if it works in Mozilla but certainly works in IE.

function blurimage(img,str)

<img src="image.gif" style="filter:blur(strength=0)" onMouseover="blurimage(this,100)" onMouseout="blurimage(this,0)">

Basically, replace image.gif with your image, and change the number (100 in this case) to whatever you want. The higher the number, the blurrier it is.

PS. Note I used blurimage and img rather than blur and image because those 2 are reserved works, you might want to be careful of that...

Assisted Solution

cirtap earned 1000 total points
ID: 8192627
as an addition to lil puffball:
all image effects work in MSIE on Windows *only* using DirectX. Not on Mac, HP, Solaris, nothing.

All you can do with Mozilla is opacity, but it uses a different syntax than MSIE.

Btw: JavaScript is not ment for image processing even if MS provides an interface on windows to do so ;-)

LVL 16

Expert Comment

ID: 10149508
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: lil_puffball {http:#8188274} & cirtap {http:#8192627}

Please leave any comments here within the next seven days.

EE Cleanup Volunteer

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question