Created
September 24, 2024 16:16
-
-
Save blackknight36/fea4e202b0a898fbe6cca85721529e76 to your computer and use it in GitHub Desktop.
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/bash | |
# Process each PNG image | |
for image in *.png; do | |
# Define the output file path for the processed image with bleed | |
output_file="bleed/${image%.*}_with_bleed.${image##*.}" | |
# Skip processing if the output file already exists | |
if [ -f "$output_file" ]; then | |
echo "Skipping $image - already processed" | |
continue | |
fi | |
echo "Processing $image" | |
# Step 1: Resize the image to 744 x 1038 pixels (cut area) | |
magick "$image" -resize 744x1038 -gravity center -extent 744x1038 "resized/resized_${image%.*}.${image##*.}" | |
# Step 2: Add a 36-pixel bleed on each side, resulting in 822 x 1122 pixels (full bleed) | |
magick "resized/resized_${image%.*}.${image##*.}" -background white -gravity center -extent 822x1122 "$output_file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment