Skip to content

ZZ76/filters

Repository files navigation

filters

image and video filters

mousedraw.py

Draw a picture manually like the style below by using mousedraw.py. The first time I saw this type of painting was on a magazine very long time ago(about 2005). It was a series portrait of famous people and I can only remeber there was a Bin Ladin in it. I cannot find any thing about it on Internet now. Please tell me if you know anything about that series.

The idea is to calculate the average color in the drawn circle area and paint on the canvas. Draw circles wherever you want without worry about the color.

To calculate the avgcolor, it first fill the area with value 1 on an 1-channel mask which value are all 0. The mask size is same as the source image. Then split the R, G, B channels of src image. For each channel, calculate the Hadamard product with the mask. So, only values in the purposed area of each channel are remained. Finally, the avgcolor of each channel can be get by sum(channel)/sum(mask).

operations:
drag mouse to draw circle
w, a, s, d - move the circle by 1 pixel
'[' / ']' - increase/ decrease radius
e - clear
c - fill the circle area
o - save image

randomrects.py

Generate circle or rectangular randomly to cover the image with calculating the average color to fill the area. More details can be added by using mousedraw.py.

s - save image

crosshatching.py

Crosshatching line style filter.

dots.py

This filter can be present better in video mode with a dynamic dot size. The radius of dot is determined by the value in grayscale. So it can't work well on images with a low contrast or too bright.



image information:

parrot from skitterphoto

eagle, leopard, tiger, zebra from pixabay

moon from Sebastian Voortman

tree from tookapic

building from Min An

Releases

No releases published

Packages

No packages published

Languages