Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5691 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8186 invoked by uid 1010); 24 Nov 2003 15:40:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 8162 invoked from network); 24 Nov 2003 15:40:50 -0000 Received: from unknown (HELO smtp3.pp.htv.fi) (213.243.153.173) by pb1.pair.com with SMTP; 24 Nov 2003 15:40:50 -0000 Received: from localhost.localdomain (cs181008.pp.htv.fi [213.243.181.8]) by smtp3.pp.htv.fi (Postfix) with ESMTP id C8FAA27B9CC; Mon, 24 Nov 2003 17:40:49 +0200 (EET) Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.10/8.12.10) with ESMTP id hAOFenZK011149; Mon, 24 Nov 2003 17:40:49 +0200 Date: Mon, 24 Nov 2003 17:40:49 +0200 (EET) Reply-To: Jani Taskinen To: Paul Troughton Cc: internals@lists.php.net In-Reply-To: <3BE30005-1E90-11D8-A3ED-000A95D9ABDE@troughton.org> Message-ID: References: <3BE30005-1E90-11D8-A3ED-000A95D9ABDE@troughton.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] [PATCH] Image sharpening function for ext/gd From: sniper@iki.fi (Jani Taskinen) There's new function in PHP 5 CVS, imagefilter(), I'd guess this would be good addition into that one.. --Jani On Mon, 24 Nov 2003, Paul Troughton wrote: >Hello, > >I was surprised to find that, although the GD image-handling functions >shipped with PHP do many useful things very well, there's no function >to sharpen an image. I found a few posts bemoaning this absence, and >therefore attach a patch which adds the function > > int imagesharpen ( resource im, int pct ) > >It performs the sharpening in-place. pct is the degree of sharpening to >be applied: 0 does nothing; 100 gives a quite noticeable effect. Values > >100 can be used for stronger sharpening. Negative values are treated >as 0. > >The routine only sharpens truecolor images, as it rarely makes sense to >attempt the operation on palletted images. > >It's a simple linear sharpening routine using a 3x3 kernel, rather than >the more flexible, but slower, unsharp masking approach used in e.g. >Photoshop, Imagemagick. However it's very effective at making resampled >photographic images (such as thumbnails) look a little more crisp. > >I've built and tested it using gcc 3.3 under Mac OS X 10.3.1. There's >nothing I'd expect to be platform-dependent in it. The attached patch >is against php4-STABLE-200311202030, but it should work with most >varieties of php-4.3.4, as the new code is fairly self-contained. > >This is my first patch for PHP. Is there anything else I should do, >beyond posting it here? > >Many thanks, > > >Paul. > >