REname scale_img.sh to white_fourcell.sh and make sure that it works in full colorspace, was reducing source image to grayscale

This commit is contained in:
Matt McWilliams 2023-02-24 15:38:33 -05:00
parent ff910b9dae
commit 35b9deb07e
1 changed files with 2 additions and 2 deletions

View File

@ -34,9 +34,9 @@ IW=$(echo "scale=${DIGITS};${OW}*${SCALE}" | bc | awk -F'.' '{print $1}')
IH=$(echo "scale=${DIGITS};${IW}*${R}" | bc | awk -F'.' '{print $1}')
TMP=$(mktemp -d)
convert -size ${OW}x${OH} xc:#FFFFFF "${TMP}/white.png"
convert -size ${OW}x${OH} -colorspace sRGB xc:#FFFFFF "${TMP}/white.png"
convert "${2}" -resize ${IW}x${IH} "${TMP}/resize.tif"
composite -gravity Center "${TMP}/resize.tif" "${TMP}/white.png" "${3}"
composite -gravity Center -colorspace sRGB "${TMP}/resize.tif" "${TMP}/white.png" "${3}"
rm -rf "${TMP}"
echo "Centered in white ${2} -> ${3}"