Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Is there a way to set a bordercolor based on an existing color at a given offset?
Using trim takes away just a little too much. I know I can specify the bordercolor manually, but I want it to figure out the color by looking at the pixel at 0,0 and use that.
I did find a solution. What a hack! It uses Windows versions of grep and gawk. The result is that the ${pixel} property now contains the color for the pixel at 0,0.
As shown by previous posts the best way is via an API.
That is read the image and extract the color, then use that color to set the border color.
However if you are stuck for a pure single Command method, you can create a canvas of the right size using a specific color from some image.
See IM Examples, Canvas from extracted Color http://imagemagick.org/Usage/canvas/#extract
However all you are doing is swaping the 'color' requirement to a 'size' requirement.
Better to use two (or more) commands to get the info you need, or use an API.
The color output from that format string should be DIRECTLY usable as a color specification for and of the color setting options. If it does NOT, then it is broken!!!