[libGD] #179 [Task opened] imagefilter: hue
[email protected] Tue, 21 Oct 2008 03:32:05 +0200 (CEST)
| Newsgroups | php.gd.bugs |
|---|---|
| Message-ID | <[email protected]> |
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Dominic (Dnic)
Attached to Project - libGD
Summary - imagefilter: hue
Task Type - Feature Request
Category - General
Status - Unconfirmed
Assigned To -
Operating System - All
Severity - Low
Priority - Normal
Reported Version - 2.0.35
Due in Version - Undecided
Due Date - Undecided
Details - There's no direct way in GD to modify the hue of an image. it can be done using imagesetpixel but this is veery slow.
Here's an example of how it can be done right now:
http://php.happycodings.com/Graphics/code32.html
....the interesting part being:
<code>for ($x=0;$x<$width;$x++){
for ($y=0;$y<$height;$y++){
$rgb = ImageColorAt($im, $x, $y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
$r2=$r;
$g2=$g;
$b2=$b;
$r=$r2*$ar[0]+$g2*$ar[1]+$b2*$ar[2];
$g=$r2*$ar[2]+$g2*$ar[0]+$b2*$ar[1];
$b=$r2*$ar[1]+$g2*$ar[2]+$b2*$ar[0];
$color = imagecolorallocate($im2, $r, $g, $b);
imagesetpixel($im2,$x,$y,$color);
}
}</code>
Can this be done in C to make it faster?
More information can be found at the following URL:
http://bugs.libgd.org/?do=details&task_id=179
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.