Best command to create a label below an image?
Posted: 2009-07-02T08:39:33-07:00
I am using ImageMagick commands as part of a Java application I am developing.
I want to do the following:
Inputs:
1. A JPEG file, of arbitrary length/width (But not smaller than, say, 500 x 500 pixels)
2. A text string, of an arbitrary length (but not super long. Maybe a paragraph at most.)
Outputs:
1. The JPEG file, which has a white 'band' appended to the bottom containing the text.
The original image's dimensions will definitely increase due to the added label.
2. The same JPEG file, which has the text displayed with a semi-transparent background
directly on top of the image, along the bottom side. The original image's dimensions will not change because
the text will simply be overlayed on it.
Now, I tried this using some FAQ I found online but the text always seems to overflow
from the image (and as a result I can only read part of it.)
Is there a way to get ImageMagick to figure out the right fontsize given an image width,
create the 'band' (label) separately with that fontsize and width, and append it to the original
image? I do understand that if we have a large space and short text, the text may become
huge and that's alright for now.
Thanks!
I want to do the following:
Inputs:
1. A JPEG file, of arbitrary length/width (But not smaller than, say, 500 x 500 pixels)
2. A text string, of an arbitrary length (but not super long. Maybe a paragraph at most.)
Outputs:
1. The JPEG file, which has a white 'band' appended to the bottom containing the text.
The original image's dimensions will definitely increase due to the added label.
2. The same JPEG file, which has the text displayed with a semi-transparent background
directly on top of the image, along the bottom side. The original image's dimensions will not change because
the text will simply be overlayed on it.
Now, I tried this using some FAQ I found online but the text always seems to overflow
from the image (and as a result I can only read part of it.)
Is there a way to get ImageMagick to figure out the right fontsize given an image width,
create the 'band' (label) separately with that fontsize and width, and append it to the original
image? I do understand that if we have a large space and short text, the text may become
huge and that's alright for now.
Thanks!