I've been reading ImageMagick documents, browsed the forum for a couple of week, but I still don't know how to cope with my task.
What I need is to select an ellipse region in the initial .jpg-file.
Then extract it. And place on transparent background.
Can anybody help me? It would be enough if you suggest me steps or ImageMagick commands sequence.
Many thanks in advance.
Yugu
Help! How to select an ellipse region and then extract it?
Re: Help! How to select an ellipse region and then extract it?
I can not remember how to draw an eclipse but this should do it with a rounded rectangle you just need to modify the code.
Code: Select all
convert -size 637x140 xc:none -fill white -draw "roundRectangle 0,0 637,140 15,15" input.jpg -compose SrcIn -composite output.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Help! How to select an ellipse region and then extract it?
Bonzo wrote:I can not remember how to draw an eclipse but this should do it with a rounded rectangle you just need to modify the code.
Code: Select all
convert -size 637x140 xc:none -fill white -draw "roundRectangle 0,0 637,140 15,15" input.jpg -compose SrcIn -composite output.png
For drawing ellipse, see http://www.imagemagick.org/Usage/draw/#primitives
Re: Help! How to select an ellipse region and then extract it?
Bonzo, fmw42, thank you very very much!!
In my case to draw an ellipse on a 240x320 image near the center the following command helped
In my case to draw an ellipse on a 240x320 image near the center the following command helped
Code: Select all
convert -size 240x320 xc:none -fill white -draw "ellipse 126,162 55,70 0,360" input.jpg -compose SrcIn -composite output.png
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Help! How to select an ellipse region and then extract it?
More typically you would read the input file first then use DstIn. That way any meta data in the (first) destination image is preserved in the output image, the same goes for the image size.
The source image can then be any size and given an offset using -geometry.
The source image can then be any size and given an offset using -geometry.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/