Hi,
Is anyone able to help me getting proper command for imagemagick.
I have one big image, and several smaller.
For each smaller image I want to rotate it by some angle, add label on it (in the center) and then put in on top of bigger image. It's a process of creating map. So I have background, and several smaller object that can by placed anywhere. Each object can by rotated and should have a short label on it.
For now I have convert with several compositions, but I can't get labeling to work.
Please help.
thanks,
Cogito
Complex compsition with imagemagick
Re: Complex compsition with imagemagick
For now I have done something like this:
convert.exe big_image.png \( small_item.png -background none -rotate 45 -gravity center -draw 'text 0,0 "item name"' -gravity NorthWest -geometry x400+100+200 \) -composite result.png
But it's have one drawback, because I would like to have the text scaled to best fit the small_item size).
convert.exe big_image.png \( small_item.png -background none -rotate 45 -gravity center -draw 'text 0,0 "item name"' -gravity NorthWest -geometry x400+100+200 \) -composite result.png
But it's have one drawback, because I would like to have the text scaled to best fit the small_item size).
Re: Complex compsition with imagemagick
Is there any way to create in memory semi transparent image with annotation that can be used on top of the smaller item image? How to properly handle the changing size (due to rotation)?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Complex compsition with imagemagick
see viewtopic.php?f=1&t=18443I have one big image, and several smaller.
For each smaller image I want to rotate it by some angle, add label on it (in the center) and then put in on top of bigger image. It's a process of creating map. So I have background, and several smaller object that can by placed anywhere. Each object can by rotated and should have a short label on it.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Complex compsition with imagemagick
If your adding a label to the center of a 'small object' the object must not be that small.
Perhaps an example of the 'object' will help give use a better idea.
How variable is the area? is the label always centered on the object? As the object rotates do you want the label to rotate?
However you may like to look at the examples for Drawing Arrows, Vectors, and Pointers..
http://www.imagemagick.org/Usage/draw/#arrows
Perhaps an example of the 'object' will help give use a better idea.
How variable is the area? is the label always centered on the object? As the object rotates do you want the label to rotate?
However you may like to look at the examples for Drawing Arrows, Vectors, and Pointers..
http://www.imagemagick.org/Usage/draw/#arrows
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Complex compsition with imagemagick
The whole process can be considered creating a map.
I have one big background.. up to 15000x15000. On that map I'm drawing several objects (actually pasting other images using composition) that can vary from 10x10 to 200x200 (or more).
I need to put a label on each of the small objects, for example a number.
For now ignore the rotation...
The problems I have at this point is that drawing text or label on top of object image might crop the label.
So the prefered way would be to move the label center point into center of the object... but I can't figure out how to do it.
I have one big background.. up to 15000x15000. On that map I'm drawing several objects (actually pasting other images using composition) that can vary from 10x10 to 200x200 (or more).
I need to put a label on each of the small objects, for example a number.
For now ignore the rotation...
The problems I have at this point is that drawing text or label on top of object image might crop the label.
So the prefered way would be to move the label center point into center of the object... but I can't figure out how to do it.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Complex compsition with imagemagick
add -gravity centerSo the prefered way would be to move the label center point into center of the object... but I can't figure out how to do it.