Center an object within an image with a solid background. Do this by first trimming the background around the object (
e_trim) and then pad (
c_lpad) and resize the canvas to the image's initial width (
w_iw) and height (
* A green border was added (
bo_4px_solid_green) to better demonstrate the object position within the image.
Here is the original image:
And here it is after trimming, padding, and resizing: