What is Nostr?
Command Line Magic /
npub17hc…tk0h
2024-09-16 14:56:04

Command Line Magic on Nostr: Often I'm wanting to take original photos and resize them for sharing purposes. You ...

Often I'm wanting to take original photos and resize them for sharing purposes. You can use a bash for loop and the convert program from ImageMagick to do this:

mkdir smaller && for i in *.jpg ; do convert -quality 70 "$i" -resize 40% "smaller/$i" ; echo "$i" ; done

ImageMagick also has a mogrify program for doing this to the images in place, but I usually like to make new images in case I make a mistake I can just run it again.
Author Public Key
npub17hcswhel45t4tnh3a7gzf4f74lfyafrq8qe3nlaejj0nk63umcdqcxtk0h