?
Solved

Blur an image

Posted on 2009-02-20
2
Medium Priority
?
1,016 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:Mr_Splash
2 Comments
 
LVL 16

Assisted Solution

by:alain34
alain34 earned 400 total points
ID: 23692376
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
 
LVL 3

Accepted Solution

by:
Mr_Splash earned 0 total points
ID: 23693630
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month16 days, 13 hours left to enroll

864 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