Comments on Highlight regions in an image with CLI
Parent
Highlight regions in an image with CLI
I have an image (a photo) and I want to highlight certain parts of this. I want to do this from the CLI.
I am planning to store the pixel coordinates of polygon vertices in a file, and when I run a script, a new image should be applied with the polygons highlighted. I am going to be making a lot of tweaks to the file, which is why I want the coordinates of highlighted areas in a text file.
How can I accomplish this? I am comfortable programming if that is the easiest option.
Post
The following users marked this post as Works for me:
User | Comment | Date |
---|---|---|
matthewsnyder |
Thread: Works for me Exactly what I was hoping for! Magic, indeed. |
Aug 21, 2023 at 22:15 |
This is an ideal case for ImageMagick.
Given input.png:
Running this command:
convert input.png -draw 'fill yellow fill-opacity 0.5 polygon 50,50 100,30 150,50 100,150' output.png
Produces output.png:
For far more information, see the documentation.
0 comment threads