Difference between revisions of "ImageMagick"
From Indie IT Wiki
Plittlefield (talk | contribs) |
Plittlefield (talk | contribs) |
||
Line 46: | Line 46: | ||
mkdir optimised | mkdir optimised | ||
− | mogrify -quality 50 -format webp -path | + | mogrify -quality 50 -format webp -resize 640x -path optimised/ *.jpg |
== HOWTO: Identify == | == HOWTO: Identify == |
Revision as of 12:55, 26 July 2023
HOWTO: Watermarking
#!/bin/bash # Initialize variables WM=/path/to/watermark.png SCALE=50 # Find all image files in current directory and watermark file -i * | grep image | awk -F':' '{ print $1 }' | while read IMAGE do echo Watermarking $IMAGE NAME=`echo $IMAGE | cut -f1 -d.` EXT=`echo $IMAGE | cut -f2 -d.` composite -dissolve 50% -gravity center -quality 100 \( $WM -resize $SCALE% \) "$IMAGE" "${NAME}_wm.${EXT}" done exit 0
HOWTO: Resize And Change Quality
convert cover_big.jpg -resize 500x500 -quality 70 cover.jpg
HOWTO: Crop And Resize To 500x500
convert old.jpg -resize 500x500^ -gravity center -crop 500x500+0+0 +repage new.jpg
HOWTO: Crop
convert old.jpg -crop 67x67+130+0 +repage new.jpg
HOWTO: Resize
convert FlexGet_NEW.png -resize 72x72^ FlexGet_NEWER.png
HOWTO: Change Format
Single file ...
convert -quality 50 -format webp myimage.jpg
All files in a folder ...
mogrify -quality 50 -format webp *.jpg
HOWTO: Save In Different Folder
mkdir optimised mogrify -quality 50 -format webp -resize 640x -path optimised/ *.jpg
HOWTO: Identify
identify FlexGet_NEWER.png
HOWTO: Display
display FlexGet_NEWER.png