Hi everybody,
Im actually working on a script generating randoms designs, including text...
I would like to "detect" when the text is going outside the "picture"/"working area".
there is a comand for that ?
Thank you
D.
Detect text or pixel outside ?
-
- Posts: 13
- Joined: 2009-07-27T05:04:53-07:00
- Authentication code: 8675309
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Detect text or pixel outside ?
Not easilly. Simplest would be to use a larger image than look for some change outside the areas concerned.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
-
- Posts: 13
- Joined: 2009-07-27T05:04:53-07:00
- Authentication code: 8675309
Re: Detect text or pixel outside ?
Thank you for your anser.
I see...
"the artistic force" of this idea is the randomless of evrything, the picture keep the same size.
I have to find a way to detect pixels outside, (of the text) and then bring it back inside the area.....
the text is random has well of course ^_^
Maybe... by knowing the width of the text. and adding the X position xtext + xpicture ? if > total width of the picture ?
So there is a command to know the width of the text ? haha i think this direction is worst
D.
I see...
"the artistic force" of this idea is the randomless of evrything, the picture keep the same size.
I have to find a way to detect pixels outside, (of the text) and then bring it back inside the area.....
the text is random has well of course ^_^
Maybe... by knowing the width of the text. and adding the X position xtext + xpicture ? if > total width of the picture ?
So there is a command to know the width of the text ? haha i think this direction is worst
D.
- GreenKoopa
- Posts: 457
- Joined: 2010-11-04T17:24:08-07:00
- Authentication code: 8675308
Re: Detect text or pixel outside ?
You could generate a label: of a specified -size, or create a label: and then -crop it. Do you know how you would handle too much text if you could detect it overflowing? Yes, you can determine the width of the new label: canvas.