Radius bug with GaussianBlur

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Radius bug with GaussianBlur

Tiberio Uricchio
Hi,
i just wanted to report a simple bug in ImageFilter.GaussianBlur:

class GaussianBlur(Filter):
    name = "GaussianBlur"

    def __init__(self, radius=2):
        self.radius = 2

    def filter(self, image):
        return image.gaussian_blur(self.radius)

As you can see, radius is always fixed at value 2 instead of using the
argument value.

Tiberio
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Reply | Threaded
Open this post in threaded view
|

Re: Radius bug with GaussianBlur

Stani-2
Strange indeed. The same is true for UnsharpMask:

class UnsharpMask(Filter):
    name = "UnsharpMask"

    def __init__(self, radius=2, percent=150, threshold=3):
        self.radius = 2
        self.percent = percent
        self.threshold = threshold
    def filter(self, image):
        return image.unsharp_mask(self.radius, self.percent, self.threshold)

http://svn.effbot.org/public/tags/pil-1.1.7a1-20090317/PIL/ImageFilter.py

On Mon, Feb 22, 2010 at 4:38 PM, Tiberio Uricchio <[hidden email]> wrote:

> Hi,
> i just wanted to report a simple bug in ImageFilter.GaussianBlur:
>
> class GaussianBlur(Filter):
>    name = "GaussianBlur"
>
>    def __init__(self, radius=2):
>        self.radius = 2
>
>    def filter(self, image):
>        return image.gaussian_blur(self.radius)
>
> As you can see, radius is always fixed at value 2 instead of using the
> argument value.
>
> Tiberio
> _______________________________________________
> Image-SIG maillist  -  [hidden email]
> http://mail.python.org/mailman/listinfo/image-sig
>



--
Phatch Photo Batch Processor - http://photobatch.stani.be
SPE Python IDE - http://pythonide.stani.be
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Reply | Threaded
Open this post in threaded view
|

Re: Radius bug with GaussianBlur

Fredrik Lundh
On Mon, Mar 1, 2010 at 10:49 PM, Stani <[hidden email]> wrote:
> Strange indeed. The same is true for UnsharpMask:

More silly than strange, I'd say -- looks like a
cut-and-paste-propagated typo that weren't caught by the (rather
shallow) filter tests.  Trivial patch here:

    http://hg.effbot.org/pil-2009-raclette/changeset/ee5c367a6a75

Thanks /F

> class UnsharpMask(Filter):
>    name = "UnsharpMask"
>
>    def __init__(self, radius=2, percent=150, threshold=3):
>        self.radius = 2
>        self.percent = percent
>        self.threshold = threshold
>    def filter(self, image):
>        return image.unsharp_mask(self.radius, self.percent, self.threshold)
>
> http://svn.effbot.org/public/tags/pil-1.1.7a1-20090317/PIL/ImageFilter.py
>
> On Mon, Feb 22, 2010 at 4:38 PM, Tiberio Uricchio <[hidden email]> wrote:
>> Hi,
>> i just wanted to report a simple bug in ImageFilter.GaussianBlur:
>>
>> class GaussianBlur(Filter):
>>    name = "GaussianBlur"
>>
>>    def __init__(self, radius=2):
>>        self.radius = 2
>>
>>    def filter(self, image):
>>        return image.gaussian_blur(self.radius)
>>
>> As you can see, radius is always fixed at value 2 instead of using the
>> argument value.
>>
>> Tiberio
>> _______________________________________________
>> Image-SIG maillist  -  [hidden email]
>> http://mail.python.org/mailman/listinfo/image-sig
>>
>
>
>
> --
> Phatch Photo Batch Processor - http://photobatch.stani.be
> SPE Python IDE - http://pythonide.stani.be
> _______________________________________________
> Image-SIG maillist  -  [hidden email]
> http://mail.python.org/mailman/listinfo/image-sig
>
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig