Hello! I'm on Windows/IM 7, and am looking to extract an n-gon (polygon of n vertices) from a JPG.
For example, given an image that is large enough, I want to extract an n-gon described by the vertices [ (10,10), (10,20), (70,65), (60,55) ]
This SO question answers just that using C++; is there a standard commandline equivalent (using magick.exe?) pls?
( Will post back here if I find reference + translate, myself )
How to extract ngon using commandline (magick.exe)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to extract ngon using commandline (magick.exe)
Use the equivalent of -draw "polygon ..." to create a mask and then use the mask to make the background transparent, then trim if desired to the bounding box of the polygon region. Sorry I do not code in Windows or C++.
Re: How to extract ngon using commandline (magick.exe)
Thank you, Fred! Searching for "imagemagick -draw polygon" brought up a post for exactly what I asked for:
-- this: http://www.multipole.org/discourse-serv ... hp?t=25286
-- which led to this: https://www.imagemagick.org/discourse-s ... =1&t=25228
-- this: http://www.multipole.org/discourse-serv ... hp?t=25286
-- which led to this: https://www.imagemagick.org/discourse-s ... =1&t=25228