#34992 [Com]: imageconvolution does not respect alpha

From: Date: Mon, 06 Aug 2007 09:32:35 +0000
Subject: #34992 [Com]: imageconvolution does not respect alpha
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115790@lists.php.net to get a copy of this message
ID: 34992 Comment by: ghosh at q-one dot com Reported By: jaanus at underwerks dot com Status: No Feedback Bug Type: GD related Operating System: Linux 2.6.13 PHP Version: 6CVS-2005-10-26 (snap) Assigned To: pajoye New Comment: This bug still occurs with 5.2.2 which is fairly new. Can't test 5.2.3 right now but it doesnt mention anything about imageconvolution in the changelog so I believe this is still unfixed. The original post about "background color" is a little bit misleading. To put it more simply: Any alpha channel information simply gets destroyed when using imageconvolution. An example image isnt really necessary because it happens with ANY png with alpha channel. I can provide one on request if absolutely necessary though. Use cases? For instance I have a dynamically generated price tag here as alpha png. I rotate it with imagerotate. Rotation makes it somewhat blurry. So afterwards I try sharpening it with imageconvolution. There you go: Alpha channel info goes down the drain... Previous Comments: ------------------------------------------------------------------------ [2005-11-03 01:00:07] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2005-10-26 14:52:28] pajoye@php.net Please provide the images you use for this test and images you like to have as result (specifying which software you use). I'm not sure about the use of alpha with convolution filter but aesthetic toys. Interpolate the alpha using the convolutions make little sense, what it does now is to get the src alpha value for a given result pixel (x,y). As a second point, you talk about background color, this is something different as the alpha channel for a given pixel. ------------------------------------------------------------------------ [2005-10-26 12:42:07] tony2001@php.net Assigned to the maintainer. ------------------------------------------------------------------------ [2005-10-26 11:15:59] jaanus at underwerks dot com Description: ------------ imageconvolution destroys 8bit alpha channel in subject image Reproduce code: --------------- <?PHP $img=imagecreatefromjpeg("image.png"); imageconvolution($img,array(array(-1,-1,-1),array(-1,16,-1),array(-1,-1, -1)), 8,0); imagejpeg($img,"test.png"); ?> Expected result: ---------------- A sharpened image with intact alpha channel, alternavly sharpened alpha channel Actual result: -------------- Image is flattened against black background even if the color data of the background indicates it should be white. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34992&edit=1

« previous php.bugs (#115790) next »