[Image-SIG] Removing specific range of colors from scanned image

jcupitt at gmail.com jcupitt at gmail.com
Tue Apr 28 21:33:25 CEST 2009

2009/4/28 Fredrik Lundh <fredrik at pythonware.com>:
>    mask = ImageMath.eval(
>        "convert(((abs(r - R)*abs(g - G)*abs(b - B)) < distance3)*255, 'L')",
>        **locals())
>    # paste in some nice color on pixels that are "close" to the target color
>    im.paste("white", mask)
> (no time to do benchmarking and detailed testing, but the above should
> be fairly efficient)

Yes it's pretty quick. I didn't realise ImageMath was so fast, thank
you for the example.


More information about the Image-SIG mailing list