1. Grab the border -fuzz 5% (and save as variable?)
2. Trim -trim (trim before resize to preserve detail?)
3. Resize -resize 980x980
4. Pad with same color border -bordercolor white -border 44x44
5. Center the image -gravity center
6. Limit the image dimensions -extent 980x980
7. Transparent BG to White -background white -alpha remove -flatten
8. Convert all images to JPG image_converted.jpg
Putting it all together:
Code: Select all
convert image.png \
-fuzz 5% \
-trim \
-resize 980x980 \
-bordercolor white \
-border 44x44 \
-gravity center \
-extent 980x980 \
-background white \
-alpha remove \
-flatten \
image_converted.jpg
- Since I'm not sure how to save the fuzz value, the border color is currently white.
- Converted image is not exactly 1024x1024 (980+44).
- Smaller images are enlarged which is not ideal. After trim, if the image is smaller than 980x980, it should just be centered.
Thanks!