note 56144 added to ref.image
| From: | timeshifting at gmail dot com | Date: | Wed, 24 Aug 2005 22:39:09 +0000 |
| Subject: | note 56144 added to ref.image | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94155@lists.php.net to get a copy of this message | ||
To sharpen an image, rather than using the code below that produces a sharpening filter with php,
use the built-in GD function "imageconvolution" which is designed for this purpose.
Matrices can be used for sharpening, blurring, edge detection, etc, ala Photoshop.
A sharpening example:
<?php
$sharpenMatrix = array(-1,-1,-1,-1,16,-1,-1,-1,-1);
$divisor = 8;
$offset = 0;
imageconvolution($myImage, $sharpenMatrix, $divisor, $offset);
?>
Below is some information on building different kinds of matrices. (If you have photoshop (or PSP,
GIMP) you can test out your matrices before applying them in PHP)
http://loriweb.pair.com/8udf-basics.html
(covers blurs)
http://loriweb.pair.com/8udf-sharpen.html
http://loriweb.pair.com/8udf-edges.html
http://loriweb.pair.com/8udf-emboss.html
----
Manual Page -- http://www.php.net/manual/en/ref.image.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56144
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56144&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56144&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56144&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56144&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56144&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56144&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56144&report=yes
Search -- http://master.php.net/manage/user-notes.php