views:

44

answers:

5

How to sharpening an uploaded image in PHP ?

Is there some PHP libraries ? What is the best ?

A: 

Here's an unsharp mask for PHP. (Unsharp mask is one of the most common types of sharpening used.)

Here's another option (using GD).

Skilldrick
+2  A: 

ImageMagick offers best quality and lot of other features. Use adaptiveSharpenImage function:

<?php
try
{
    $image = new Imagick('image.png');
    $image->adaptiveSharpenImage(2,1);
}
catch(ImagickException $e)
{
    echo 'Error: ' , $e->getMessage();
    die();
}

header('Content-type: image/png');
echo $image;
?>
shamittomar
A: 

The most straightforward way is to use PHP's imageXXX() routines, such as imagecreatefromjpeg() etc. For more powerful scripted image editing, consider ImageMagick, or some other scriptable image processor.

tdammers
GD does not have a sharpening function.
Pekka
Aww, looks like you're right... all sorts of filters, but no sharpening...
tdammers
A: 

In this PHP Manual comment, someone is referring to function imageconvolution(), complete with an example.

Lekensteyn
+1  A: 

You can use ImageMagick. This call is one good solution

renick