Re: [GD-DEVEL] Transparency Optimization in gd_gif_out.c
| From: | Pierre | Date: | Sun, 06 Jan 2008 13:34:16 +0000 |
| Subject: | Re: [GD-DEVEL] Transparency Optimization in gd_gif_out.c | ||
| References: | 1 | Groups: | php.gd.devel |
| Request: | Send a blank email to php-gd-devel+get-304@lists.php.net to get a copy of this message | ||
Hi David!
On Jan 6, 2008 9:59 AM, David Reiss <dreiss@cs.stanford.edu> wrote:
> I'm looking at gd-2.0.35, gd_gif_out.c, line 416. It looks like this
> loop (starting on line 407) is meant to loop over the entire temporary
> image and, for each pixel that is the same color as the corresponding
> pixel in the previous image, set the pixel to the transparent color.
> I can't understand the break statement inside of the innermost
> conditional. It appears to abort the inner loop whenever it sets a
> transparent pixel, preventing it from setting more than one pixel on
> any given line. I commented out this statement and got much better
> results when creating animated GIF images. I tried to use cvs
> annotate to figure out why this line was added, but I wasn't able to
> track it through a merge. I was wondering if anyone could help me
> track down what the function of this line is and if it is safe to
> remove it from the gd trunk.
I think it is a bug, it should fill the unchanged areas with the
transparent color and not simply set one pixel. I don't know this code
very well yet (quite old :), but I think we should fix that soonis.
Can you provide some examples with and without this part?
Thanks for your feedbacks!
--
Pierre
http://blog.thepimp.net | http://www.libgd.org