Process 9-Patch Image with ImageMagick
<p>How do I do something with a 9-Patch image with ImageMagick?</p>

<p>To simplify, I need to apply any ImageMagick operation on a rectangle that starts at upper-left at <code>(1, 1)</code> and ends at lower-right at <code>(width - 2, height - 2)</code>. The operation must not touch the 1 pixel border of the image.</p>

<p>For example, I want to replace the colors in the rectangle described above. How do I do that?</p>