22 June 2022
convert -size 300x300 xc:none -draw "roundrectangle 0,0,300,300,150,150" mask.png
-size 300x300
is the size of created image.
300,300
refers to width and height of the image. This has to be adjusted according the image. That is the mask has to be the size of the original_image.
150,150
refers to the border radius of the mask. It determines the curves of the edges.
convert original_image.png -matte mask.png
-compose DstIn -composite rounded_original_image.png
convert rounded_original_image.png -crop 300x300 rounded_original_image.png
convert original_image.jpg -gravity East -chop 1000x0 chopped_image.jpg
convert original_image.jpg -gravity West -chop 1000x0 chopped_image.jpg
convert original_image.jpg -gravity South -chop 0x1000
-gravity West -chop 1000x0
-gravity East -chop 1000x0
-gravity North -chop 0x200
chopped_image.jpg`
convert original_image.jpg -crop 1280x1280+500+125 chopped_image.jpg
Compress image
magick original_image.JPG -resize 40% chopped_image.JPG