Resize images to specific target size while padding remaining space with transparency

convert -auto-orient -background "#00000000" original.jpg -resize 720x576 -gravity center -extent 720x576 resized.png

Resize all images of a file-type inside a folder

for PHOTO in *.jpg
    convert -auto-orient -background "#00000000" "$PHOTO" -resize 720x576 -gravity center -extent 720x576 "resized/$PHOTO.png"

Replace a color in image with different color

convert input.png -fuzz 90% -fill "#628FDB" -opaque "#000000" star_blue.png
  • fuzz: Percentage matching of the color
  • opaque: Color to replace
  • fill: Color to replace with

Reverse the RGB colors in an image

convert input.png -channel RGB -negate output.png

Resize image and then crop center to fit target size

convert original.jpg -resize 720x576^ -gravity center -crop 720x576+0+0 +repage resized.png

Automation is exciting 🤖