Code: Select all
convert rect.png \( +clone -rotate 90 +clone -mosaic \) +swap -gravity center -compose Src -composite square.png
Input image:
Code: Select all
convert \( \( +size xc:blue xc:green xc:red -append \) -rotate -90 -scale 100x50! \) rect2.png
squared:
However, this doesn't work for images that I have cropped as follows: although the rectangular image that I am creating by upsizing and cropping has the correct size (100x50), the squared image is not 100x100 as it should be but 105x110.
problem example
Input image:
Code: Select all
convert \( \( +size xc:blue xc:yellow xc:red -append \) -rotate -90 -scale 100x50! \
-resize 110% -gravity center -crop 100x50+0+0 \) rect1.png
squared:
I am at my wits' end!