基本的处理图片的功能:灰度、黑白、反色

fengbohan 0d71fb70b3 init 9 mesi fa
ReadMe.md 0d71fb70b3 init 9 mesi fa
color.jpg 0d71fb70b3 init 9 mesi fa
color.png 0d71fb70b3 init 9 mesi fa
gray.png 0d71fb70b3 init 9 mesi fa
img.py 0d71fb70b3 init 9 mesi fa
output.png 0d71fb70b3 init 9 mesi fa
requirements.txt 0d71fb70b3 init 9 mesi fa

ReadMe.md

功能列表

  • 生成灰度图
  • 生成黑白图
  • 图片反色

快速开始

  1. 安装依赖

    pip install -r requirements.txt
    
  2. 运行程序

    # 黑白
    python .\img.py .\color.png -t
       
    # 灰度
    python .\img.py .\color.png -g
       
    # 反色
    python .\img.py .\color.png -i
    

用法说明

usage: img.py [-h] [-g | -i | -t] [-o OUTPUT] img

positional arguments:
  img                   input img file name

options:
  -h, --help            show this help message and exit
  -g, --gray            convert color img to gray
  -i, --invert          invert color img
  -t, --threshold       to produce a black and white image
  -o OUTPUT, --output OUTPUT
                        output img file name