I’m looking for a way that I can take say, a 200×200 pixel image and center it over a background that’s 500×500 pixels. The background should be the color of the top-left corner of the 200×200 pixel image.
I get the -gravity and -fill flags, but I’m having trouble finding a way to grab that top-left corners color to pass to the -fill flag.
I haven’t found an easier way, so I’m cropping the corner, resizing it which results in a solid color image, then compositing them. Made possible by the use of STDIN and STDOUT file descriptors. The “png:-” bits tell imagemagick to pass the image data in PNG format from what I understand.