Re: [GD-DEVEL] Gaussian Blur

[email protected] (Chris Reuter) Thu, 5 Dec 2013 23:53:47 +0000
Newsgroups php.gd.devel
Message-ID <[email protected]>
On Thu, Dec 05, 2013 at 03:15:27PM -0800, Chris Barker wrote:
[...]
> Anyway, my thoughts:
[...]

> >     2. The image will be converted to true color where it wasn't
> >     before.
> >
> 
> Ouch! That I really don't like -- in fact, the reason I'm wrapping gd at
> all is to get palletted image support for my projects -- and I really
> wouldn't want anything to convert my images for me.

Just FYI, some of the scaling code already does this.  I suppose we
ought to track down where it does this and ensure that it doesn't
modify the source image.

> One could argue that running a gaussian blur on a palletted image is let
> than ideal anyway (and you'd be right), but if the existing API supports it
> it'd be better not to change that.
> 
> Could your code switch on the image type an cal the old routing for
> palleted images?

The easiest thing would be to just leave in the old GB and add mine as
an additional thing.

There's a matrix convolution function that a bunch of functions wrap
to do various filtery things, one of them being Gaussian blur.
Changing it to use mine would actually increase the code size.

However, it also means that there are now two different unrelated
Gaussian blur functions and that kind of grates on me.  I was hoping
to unify it.

Oh well.  The real world wreaks all kinds of havoc on my code.  I'll
leave the old GB alone.


                              --Chris


-- 
Chris Reuter                                                 http://www.blit.ca
"There is no 'I' in team."
"There's an 'eat me' if you use the 'e' twice."
            --artyw and tooloud, <[email protected]>