Last active
February 22, 2023 03:59
-
-
Save bobbotron/7ca9f848afb4d1afa4ca6320fffc0426 to your computer and use it in GitHub Desktop.
Contact print generator
This file contains 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
#!/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