Last active
April 12, 2022 05:23
-
-
Save funnyzak/d495e817c7e3e1319898687e4f52b8ae to your computer and use it in GitHub Desktop.
Convert images to HEIC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Iterate through the current folder and convert all JPG|JPEG|PNG|BMP format pictures to HEIC format, delete the original files after success | |
# 遍历当前文件夹,把所有JPG|JPEG|PNG|BMP格式图片转换为HEIC格式,成功后删除原文件 | |
find -E . -iregex ".*\.(jpg|jpeg|png|bmp)" -print | xargs -n1 -I {} sh -c 'echo "Converting \"{}\" to HEIC." && ((magick mogrify -quiet -format HEIC {} && rm {} && echo "success and deleted {}.") || echo "fail.")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment