Hi,
I'm trying to add multicolored text (ie. each letter a different color) to an image, I'm using the command line tools.
How would I do this?
I'd Image I'd have to draw out each letter of the text indivually, but how do I get the spacing to do that properly, programmatically?
Multi colored text.. font metrics?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
For different colors and styles the only way is to draw each letter (or word) seperatally, then append them together as appropriate. If you are using the same font and font size, straight append should work perfectly fine. If you chnage fonts, pointsizes, or change stroke widths, or do other effects to the letters then direct appending will nolonger work.
Basically IM is NOT as Wordprocessor, it is a Image processor. Though it can (with difficulty) get simular results.
For examples of this type of handling see...
Creating Lines of Mixed Font Styles
http://www.cit.gu.edu.au/~anthony/graph ... font_lines
Basically IM is NOT as Wordprocessor, it is a Image processor. Though it can (with difficulty) get simular results.
For examples of this type of handling see...
Creating Lines of Mixed Font Styles
http://www.cit.gu.edu.au/~anthony/graph ... font_lines
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
If this is typical of what you are attempting, you could try recoloring the color gradient in a specific reagion. the offset and size of the region could be determined by finding the text lengths.
Basically what this shows is that the bounding box of the font has the stroke width extra space added to the bounds.
Hmm do you have the font and commands you used for the above?
Mail it to me so I can show this as a problem on the IM examples web pages.
Mail as I am dissappearing for the whole of april overseas. (Austrialia to Europen via Korea)
Basically what this shows is that the bounding box of the font has the stroke width extra space added to the bounds.
Hmm do you have the font and commands you used for the above?
Mail it to me so I can show this as a problem on the IM examples web pages.
Mail as I am dissappearing for the whole of april overseas. (Austrialia to Europen via Korea)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
If you are using an API you can get the bounds of a string directly.
This includes the outside bounds and the 'movement of the cursor'
which is what you are needing.
This includes the outside bounds and the 'movement of the cursor'
which is what you are needing.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/