Page 1 of 1
css-like declarations aimed at ImageMagick?
Posted: 2008-11-05T18:36:06-07:00
by pooco
im trying to write a templated interface to imagemagick.
it would basically be what CSS is to HTML.
it says "put some text here, use this font, use this color, use a slight dropshadow. put more text on top of it here, etc etc"
nothing terribly complicated.
is there a sane way to do this that's already been hammered out somewhere? any hints?
thank you!
Possibly related thread here
Re: css-like declarations aimed at ImageMagick?
Posted: 2008-11-05T19:16:44-07:00
by fmw42
pooco wrote:im trying to write a templated interface to imagemagick.
it would basically be what CSS is to HTML.
it says "put some text here, use this font, use this color, use a slight dropshadow. put more text on top of it here, etc etc"
nothing terribly complicated.
is there a sane way to do this that's already been hammered out somewhere? any hints?
thank you!
Possibly related thread here
I don't know how relevant these are but you might want to look at
http://www.designconsult.nl/imagemagick/
Also I have a command line script for doing texteffects at
http://www.fmwconcepts.com/imagemagick/index.html
Re: css-like declarations aimed at ImageMagick?
Posted: 2008-11-05T20:20:07-07:00
by el_supremo
Do you mean something like
MagickStudio?
Pete
Re: css-like declarations aimed at ImageMagick?
Posted: 2008-11-06T17:37:03-07:00
by pooco
thank you, but i don't think either of these are quite what i'm looking for.
i was hoping there would be a standardized way to define how text is laid out within imagemagick
something that takes a definition file, possibly like this:
image: 500x500px
text1: arial, black, 10px from top, 5px from left, drop shadow, ...
text2: helvetica, white, 5px from top, 10px from right
background: foo.png, repeat-x
and a layout file, possibly like this:
<text1>hello there</text1>
<text2>hello there</text2>
and creates an image. similar to the relationship with CSS and HTML, but skewed for IM and graphic layout.
edit: i suppose both could be XML-based, which would make parsing easy.
Re: css-like declarations aimed at ImageMagick?
Posted: 2008-11-06T19:38:46-07:00
by fmw42
pooco wrote:thank you, but i don't think either of these are quite what i'm looking for.
i was hoping there would be a standardized way to define how text is laid out within imagemagick
something that takes a definition file, possibly like this:
image: 500x500px
text1: arial, black, 10px from top, 5px from left, drop shadow, ...
text2: helvetica, white, 5px from top, 10px from right
background: foo.png, repeat-x
and a layout file, possibly like this:
<text1>hello there</text1>
<text2>hello there</text2>
and creates an image. similar to the relationship with CSS and HTML, but skewed for IM and graphic layout.
edit: i suppose both could be XML-based, which would make parsing easy.
Perhaps the Magick Scripting Language is where you want to start. I believe that it is XML, but don't know much about it or where there is any documentation, but you can find some things here:
viewforum.php?f=9
and the thread at
viewtopic.php?f=9&t=9627
Re: css-like declarations aimed at ImageMagick?
Posted: 2008-11-07T13:32:38-07:00
by pooco
thanks, interesting! too bad there are no docs and support seems dead.
if the markup is thorough enough, it may just be a matter of putting some kind of variable inside:
<draw text="$t" />
and having that be replaced at run-time.
note to developers: its possible that the markup remains obscure because it's not pushed very hard. proper documentation would help tremendously. guess i'll play around and see how adept it as at manipulating text (drop shadows,etc) and such. one feature that would be very handy is replacing scripted variables on the commandline somehow:
run-script-executable scriptfile.msl -text1="hello world"
Some amateur docs:
http://www.linux-nantes.org/~fmonnier/I ... ed-msl.php
http://www.cs.sunysb.edu/documentation/ ... njure.html
edit:
thread continued here