Linux 下使用命令将图片反色

# 单张图片反色
convert -negate image.png image_ne.png

# 单张图片反色(替换)
convert -negate image.png image.png

# 单张图片反色,修复格式不兼容
convert image.png image.png && convert -negate image.png image_ne.png

# 单张图片反色,修复格式不兼容(替换)
convert image.png image.png && convert -negate image.png image.png

# 当前目录下,包括子文件夹的png图片反色
find . -name "*.png" -type f -exec sh -c 'convert $0 $0 && convert $0 -negate ${0%.png}_ne.png' {} \;

# 当前目录下,包括子文件夹的png图片反色(替换)
find . -name "*.png" -type f -exec sh -c 'convert $0 $0 && convert -negate $0 $0' {} \;
posted @ 2023-12-02 11:22  Leeds_Garden  阅读(36)  评论(0编辑  收藏  举报