css-like declarations aimed at ImageMagick?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
pooco

css-like declarations aimed at ImageMagick?

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: css-like declarations aimed at ImageMagick?

Post 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
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: css-like declarations aimed at ImageMagick?

Post by el_supremo »

Do you mean something like MagickStudio?

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
pooco

Re: css-like declarations aimed at ImageMagick?

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: css-like declarations aimed at ImageMagick?

Post 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
Last edited by fmw42 on 2008-11-07T13:59:21-07:00, edited 1 time in total.
pooco

Re: css-like declarations aimed at ImageMagick?

Post 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
Post Reply