2020-02-11 23:10:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Script to change the generated calibration tif files to
|
|
|
|
# properly scaled files that is a lossless png. The resulting
|
|
|
|
# file should be massively smaller--100's of MBs to KBs.
|
|
|
|
|
|
|
|
#Requires ImageMagick
|
|
|
|
|
|
|
|
#Printer DPI
|
2024-04-24 15:47:52 +00:00
|
|
|
if [[ "${1}" == "" ]]; then
|
|
|
|
echo "Please provide your DPI as your first argument"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
DPI=${1}
|
2020-02-11 23:10:37 +00:00
|
|
|
#Location of calibration files
|
|
|
|
CALIBRATION_FILES="../filmless_calibration/*.tif"
|
|
|
|
|
|
|
|
echo "Changing calibration files to ${DPI}dpi and converting to .png..."
|
|
|
|
|
|
|
|
for f in $CALIBRATION_FILES
|
|
|
|
do
|
|
|
|
name=$(basename "$f" .tif)
|
|
|
|
#echo $name
|
2020-03-03 23:06:28 +00:00
|
|
|
echo "Converting $f -> ../filmless_calibration/${name}.png @ ${DPI}dpi..."
|
2020-02-11 23:10:37 +00:00
|
|
|
convert $f -units PixelsPerInch -density $DPI "../filmless_calibration/${name}.png"
|
|
|
|
rm $f
|
|
|
|
done
|