How do I trim counter edges

Goal: to trim counter edges.

Relevant reading:

approach A

If all images have same width and heigth it is perfectly OK to "trim from outside" i.e. instruct ImageMagick to remove border of specific width:

      magick <input-file> -shave WxH <output-file>

approach B

If images don't have same width and height (i.e. you have auto-cropped counters from counter sheets), trimming them from outside could possible result with non-uniform-sized output. In such case it is better to "crop from inside":

      magick <input-file> -gravity center -crop WxH+0+0 <output-file>