Skip to content

Instantly share code, notes, and snippets.

@cmpscabral
Last active July 6, 2022 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmpscabral/b77a56f508070e7c882888ba54776b4e to your computer and use it in GitHub Desktop.
Save cmpscabral/b77a56f508070e7c882888ba54776b4e to your computer and use it in GitHub Desktop.
convert RAW/CR2 to JPEG / resize
# convert raw to jpeg
for i in *.CR2; do sips -s format jpeg $i --out "${i%.*}.jpg"; done
# resize jpegs
for i in *.jpg; do sips -Z 2500 $i --out "./small/${i%.*}.jpg"; done
# convert to tiff with lzw compression
sips -s format tiff -s formatOptions lzw [file] --out [file]
# convert to jpeg lossless
sips -s format jpeg -s formatOptions 100 [file] --out [file]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment