Blur an image

Hello,

I need to apply a gaussian blur to an image using PHP, I know that GD and Imagemagick are available on my server.

I'm working with a jpg on the server, let's say example,jpg.

I need to apply the blur to that image and then save it again. It would be great if I could control the level of blur too.

Thanks
LVL 3
Mr_SplashAsked:
Who is Participating?
 
Mr_SplashConnect With a Mentor Author Commented:
Thanks for the replay alain,

however that method would be very overkill. I've now learnt that PHP5 has a blur function built in that I can simply repeat until I get the desired blur level.

For anyone else trying this I've put the code below. Change the number of loops to alter the amount of blur.
for ($x=0; $x<40;$x++) {
  imagefilter($im, IMG_FILTER_GAUSSIAN_BLUR);
}

Open in new window

0
 
alain34Connect With a Mentor Commented:
Hello Mr_Splash,

You could phpthumb http://phpthumb.sourceforge.net/

If you look at example 15, you can see the blur process in action
http://phpthumb.sourceforge.net/demo/demo/phpThumb.demo.demo.php

Regards,

alain34
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.