Skip to content

wwtg99/image_filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Filter

An image operation and filter tool depends on Pillow, just for study and communication.

Dependency

  • Python3
  • Numpy
  • Pillow

Demo

Usage

Show Help

python image_filter.py -h

List filters

python image_filter.py -l

Filter image

python image_filter.py -f grey -i images/test.jpg -o images/

Some filters need parameters

python image_filter.py -f gaussian_blur -i images/test.jpg -o images/ -a radius=3

Resize image (thumbnail)

python image_filter.py -i images/test.jpg -o out.jpg -f rgb --width=300 --height=300

Add water mark image

python image_filter.py -i images/test.jpg -o images/img_mark.jpg -f rgb -m images/water_mark.png -p RT

Add water mark text

python image_filter.py -i images/test.jpg -o images/txt_mark.jpg -f rgb -x wwtg99 --font-size=40 --font-color=100,100,100,200

Filters

  • rgb: RGB image
  • rgba: RGBA image
  • grey: Gray scale
  • hand_drawn: Hand drawn
  • edge_curve: Find edges
  • blur: Blur
  • contour: Contour
  • edge_enhance: Enhance edge
    • more: More enhancement
  • emboss: Emboss
  • smooth: Smooth
    • more: More smooth
  • sharpen: Sharpen
  • gaussian_blur: Gaussian blur
    • radius: Blur radius
  • min: Picks the lowest pixel value in a window with the given size
    • size: 3 or 5, default 3
  • median: Picks the median pixel value in a window with the given size
    • size: 3 or 5, default 3
  • max: Picks the largest pixel value in a window with the given size
    • size: 3 or 5, default 3
  • mode: Picks the most frequent pixel value in a box with the given size. Pixel values that occur only once or twice are ignored; if no pixel value occurs more than twice, the original pixel value is preserved
    • size: 3 or 5, default 3
  • unsharp_mask: Unsharp mask
    • radius: Blur Radius, default 2
    • percent: Unsharp strength, in percent, default 150
    • threshold: Threshold controls the minimum brightness change that will be sharpened, default 3
  • emboss_45d: Emboss from 45 degree
  • sharp_edge: sharp edge
  • sharp_center: sharp center
  • emboss_asym: Asymmetric emboss

Example

Origin 原图

Origin


RGB

RGB


Grayscale 灰度图

Grayscale


Hand drawn 手绘图

Hand drawn


Find edges 边缘线

Find edges


Blur 模糊

Blur


Contour 描边

Contour


Edge Enhance 边缘强化

Edge Enhance


Emboss 浮雕

Emboss


Smooth 平滑

Smooth


Sharpen 锐化

Sharpen


Gaussian Blur 高斯模糊

Gaussian Blur


Min Filter

Min Filter


Median Filter

Median Filter


Max Filter

Max Filter


Mode Filter

Mode Filter


Unsharp Mask 锐化遮罩

Unsharp Mask


Emboss 45d 45 度浮雕

Emboss 45d


Sharp Edge 边缘锐化

Sharp Edge


Sharp Center 中心锐化

Sharp Center


Emboss Asymmetric 非对称浮雕

Emboss Asymmetric


Image water mark 图片水印

Image water mark


Text water mark 文字水印

Text water mark

About

An image filter tools depends on Pillow.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages