A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
-bash/zsh: imgp command not found # Windows (WSL2) sudo apt-get update sudo apt-get install imgp # Debian apt-get install imgp # Ubuntu apt-get install imgp # Kali Linux apt-get install imgp # Fedora dnf install imgp # Raspbian apt-get install imgp # Dockerfile dockerfile.run/imgp
imgp 是一个命令行图像调整器和旋转器,适用于 JPEG 和 PNG 图像。它可以一次调整(或缩略图)和旋转数千张图像,速度快如闪电,同时节省大量存储空间。
imgp 由多处理、SIMD 并行性(得益于 Pillow-SIMD 库)、智能自适应算法、递归操作、shell 完成脚本、EXIF 保存(等等)提供支持,是一款非常灵活的实用程序,具有记录详实且易于使用的选项。
imgp 旨在成为 Nautilus Image Converter 扩展的更强大的替代品,不依赖于任何文件管理器,而且速度更快。在没有集成 Nautilus 的桌面环境(如 Xfce 或 LxQt)上,imgp 将为您节省时间。文件管理器 nnn 提供了一个脚本,可以使用 imgp 批量调整图像大小。
imgp [OPTIONS] [PATH [PATH ...]]
# 转换包含有效图像格式的单个图像和/或整个目录 imgp -x [1366x1000] [path/to/directory] [path/to/file] # 将图像缩放 75% 并将源图像覆盖为目标分辨率 imgp -x [75] -w [path/to/file] # 将图像顺时针旋转 90 度 imgp -o [90] [path/to/file]
-h, --help Show help text and exit. -x, --res=res Output resolution in HRESxVRES or percentage. -o, --rotate=deg Rotate clockwise by a specified angle (in degrees). Negative inputs rotate anti-clockwise. Rotation by 0 degree is not allowed. -a, --adapt Adapt to specified resolution considering the orientation of the image. Disabled by default. -c, --convert Convert PNG images to JPEG to save on space. The output image is saved with '.jpg' extension. -e, --eraseexif Erase EXIF metadata of JPEG images. Preserved by default. -f, --force Force to the exact specified resolution. Disabled by default. -H, --hidden Include hidden (dot) files. By default hidden files are skipped. -i, --includeimgp Process _IMGP files. Risky due to potential race conditions. -k, --keep Do not process if image hres or vres matches specified hres or vres, or --res is 100. However, PNG images are converted to JPEG if --convert option is specified and JPEG images are made progressive is --progressive option is specified. -n, --enlarge Enlarge smaller images. By default smaller images are not scaled if specified resolution is greater. -N --nearest Use nearest neighbour interpolation for PNG images instead of default antialias. -p, --optimize Optimize output images using PIL library optimization algorithm. Disabled by default. -P, --progressive Save all output JPEG images as progressive, even if the source is not. -q, --quality=N Save the image with a specified quality factor N (scale 1-95, default 75). JPEG only. -m, --mute Do not show any operational output. -M, --minresres minimum resolution in HxV or percentage of --res to resize -r, --recurse Recursively process sub-directories. By default only the specified directory is processed. Symbolic links are ignored to avoid recursive loops. -s, --size=byte Minimum size in bytes required to process an image. Acts as a guard against processing low-resolution images. Default 1024 bytes. -w, --overwrite Overwrite the source images. By default an output image is saved with _IMGP appended to the source image name. NOTE: If overwrite and convert options are used together, source PNG images are deleted. -d, --debug Enable debugging.
imgp 转换包含有效图像格式的单个图像和/或整个目录:
imgp -x 1366x1000 path/to/directory path/to/file
imgp 将图像缩放 75% 并将源图像覆盖为目标分辨率:
imgp -x 75 -w path/to/file
imgp 将图像顺时针旋转 90 度:
imgp -o 90 path/to/file