Skip to content

Instantly share code, notes, and snippets.

@bobbotron
Last active February 22, 2023 03:59
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 bobbotron/7ca9f848afb4d1afa4ca6320fffc0426 to your computer and use it in GitHub Desktop.
Save bobbotron/7ca9f848afb4d1afa4ca6320fffc0426 to your computer and use it in GitHub Desktop.
Contact print generator
#!/bin/sh
# Generates a contact print from a folder of DNGs, outputing the
# folder above.
# This requires a bash shell and ImageMagick installed.
for filename in *.DNG; do
f="${filename%.*}"
if [ -f "${f}.jpg" ]
then
echo "Skipping conversion of ${filename}. Delete JPG to reconvert."
else
echo "Converting ${filename}"
magick mogrify -format jpg -quality 75 -resize 800x800 ${filename}
fi
done
echo "Creating contact print"
magick montage -verbose -label '%f' \
-pointsize 32 -background '#000000' -fill 'gray' \
-define jpeg:size=500x500 -geometry 500x500+2+2 \
-tile 6x \
-auto-orient *.jpg ../contact.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment