This is not a finding edge problem but I am trying to find the background color of the image, in order to find it, I am trying to get the edge of the image and guess the best color.

In order to do so, I want to remove the center of the image and just get image like a frame with transparent center.

Is it possible through ImageMagick?

For example

[![enter image description here](https://i.stack.imgur.com/132ro.png)](https://i.stack.imgur.com/132ro.png)

If want

[![enter image description here](https://i.stack.imgur.com/UM9Pf.png)](https://i.stack.imgur.com/UM9Pf.png)