使用python轻松操作图像:更改亮度、对比度、锐度、大小

pillowcover-gui的Python项目详细描述


枕套

使用python对图像进行大规模操作:更改亮度、对比度、清晰度、调整大小、压缩、裁剪和转换(例如png到jpg)。 使用枕头的简单脚本(包装纸)。 许可使用:GNU通用公共许可v3或更高版本(GPLv3+)

要求

Python>;=3.5,枕头

安装

最简单的选择是使用sudo安装pip。

sudo python3 -m pip install pillowcover --upgrade

--或者-- 以不带sudo的用户身份安装。这会将其安装在~/.local/bin/中,请确保此路径位于$path中。

python3 -m pip install --user pillowcover --upgrade

如果找不到,请将以下内容添加到.bashrc或.zshrc中

# Add to PATH to Install and run programs with "pip install --user"exportPATH=$PATH:~/.local/bin

用法

将亮度、对比度和清晰度提高20%,并调整所有图像(横向、纵向)的大小 最大尺寸为1920像素(使用最大尺寸。高或宽)并压缩到60% 在给定的文件夹中,同时保持相同的纵横比。

pillowcover -d /home/user/Pictures/ -b 1.20 -c 1.20 -s 1.20 -r 1920 -q 60

裁剪(左角640*480)和转换(从PNG到JPG)文件夹中的所有图像。

plc -d /home/user/Pictures/ -k "0,0,640,480" -x jpg

使用选项

usage: pillowcover [-h][-v][-d DIR][-o OUTPUT_DIR][-b BRIGHTNESS][-c CONTRAST][-s SHARPNESS][-r RESIZE][-R RESIZE_RATIO][-k CROP][-q COMPRESSION][-x EXTENSION][image_file]

PillowCover: Mass Manipulate Images Using Python: Change Brightness, Contrast,
Sharpness, Resize, Compress, Crop and Convert. A simple script (wrapper) using
pillow. Licensed Under: GNU General Public License v3 or later (GPLv3+)

positional arguments:
  image_file            Full path to the image file to edit

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program\'s version number and exit
  -d DIR, --dir DIR     Path to the directory containing the image files
  -o OUTPUT_DIR, --out-dir OUTPUT_DIR
                        Path to output directory to store edited images. by
                        default they get stored in (parent
                        director)/pillowcover-output
  -b BRIGHTNESS, --brightness BRIGHTNESS
                        Change brightness level, 1.00 is the current value
  -c CONTRAST, --contrast CONTRAST
                        Change contrast level, 1.00 is the current value
  -s SHARPNESS, --sharpness SHARPNESS
                        Change sharpness level, 1.00 is the current value
  -r RESIZE, --resize RESIZE
                        Resize img, keep ratio. provide the maximum
                        length/width value as one number. e.g pillowcase.py
                        img -r 1920
  -R RESIZE_RATIO, --resize-ratio RESIZE_RATIO
                        Resize img by providing new width and length e.g
                        pillowcase.py img -R "640 480"
  -k CROP, --crop CROP  Crop img by providing starting point then width and
                        length from it e.g pillowcase.py img -k "0,0,640,480"
  -q COMPRESSION, --compression-quality COMPRESSION
                        Compression quality 1-100, 100 means no compression at
                        all
  -x EXTENSION, --extension EXTENSION
                        Specifiy the output extension. Can be 'jpg', 'jpeg',
                        'png' Default is same as the input file's. e.g
                        pillowcase.py -d imgdir -x "jpg"

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法使用JSF访问托管bean方法   java是制作具有多值类型的HashMap的正确方法   javafx中TicTacToe的java更新UI   windows Java文件。getCanonicalFile()无法处理冒号“:”   java在一个布局屏幕中创建多个(26)按钮   java Android Studio:Gradle构建完成,有251个错误   我们如何在Java上为callfireapiclient编写单元/集成测试?   java无法将1715UTC转换为本地/gmt类型   具有已定义的数字序列的JAVA循环   Java程序正在netbeans中编译,但未在CMD中编译,包不存在   java Android构造函数和onCreate()之间有什么区别?   java配置弹性搜索结果评分   java LibGDX纹理是否可绘制?   java如何在Android中设置应用程序默认打开pdf   java是否有一种创造性的方法将多个参数传递给contentEquals()方法?   java在Android上存储Ed25519私钥