MSL Documentation/Tutorial?

Discuss the conjure program and the Magick Scripting Language (MSL) here. MSL is an XML-based wrapper to the ImageMagick image-processing functions.
Post Reply
d-fens

MSL Documentation/Tutorial?

Post by d-fens » 2007-09-06T03:20:19-07:00

Hi folks,

i intend to use MSL for my purposes, but i can't find a really good documentation or tutorials. MSL is the best choice for me because i already have XML-Output which i only need to transform via XSLT. Maybe i do not see the wood for the trees, but after searching the web for hours i feel rather helpless.

Please give me some hints.

Thank you!

User avatar
magick
Site Admin
Posts: 10691
Joined: 2003-05-31T11:32:55-07:00

Re: MSL Documentation/Tutorial?

Post by magick » 2007-09-06T06:21:29-07:00

We think MSL is a good idea but very few people have shown interest so we have not put much development effort into it or its documentation. If you have specific questions post them here. If you need a new feature, ask and we'll try to implement it.

d-fens

Re: MSL Documentation/Tutorial?

Post by d-fens » 2007-09-06T07:46:55-07:00

Well, i think i don't need any new features (for now). A list of elements and their attributes would be a good start, also some hints about nesting elements.

I already found some example scripts on the web, but when trying to execute them in the windows console using

Code: Select all

conjure test.msl
i get error messages like

Code: Select all

conjure: unrecognized element `append'.
What's that about?

My aim is to position images and automatically word-wrapped text (like caption does) on a canvas. As i pointed out in my first posting, i already have a XML-Output with the text elements and references to image files, so a XSL transform into MSL should do the job.

By the way: i think MSL is a great idea! :D

User avatar
magick
Site Admin
Posts: 10691
Joined: 2003-05-31T11:32:55-07:00

Re: MSL Documentation/Tutorial?

Post by magick » 2007-09-06T09:30:04-07:00

In principle you can use any ImageMagick option described here http://www.imagemagick.org/script/comma ... ptions.php . However, we suspect some options have not made its way into MSL just yet. If you need an option thats not supported, post here and we will make it available in the ImageMagick beta release generally within 48 hours.

Post the content of your test.msl script here so we can download it and reproduce the problem.

d-fens

Re: MSL Documentation/Tutorial?

Post by d-fens » 2007-09-07T00:35:19-07:00

Here is the code of the example. When i try to open it with imdisplay i get the message "imdisplay.exe: Must specify image size". Probably i've overseen some basics, but i really don't get it at the moment.

Code: Select all

<?xml version="1.0" ?>
<msl>
  <image>
    <append>
      <layer>
        <canvas width='50' height='50' color='#D33' />
      </layer>
      <layer>
        <canvas width='50' height='50' color='#5A0' />
      </layer>
      <layer>
        <canvas width='50' height='50' color='#29D' />
      </layer>
    </append>
    <display />
  </image>
</msl>
EDIT: Even if i replace the 3rd line by

Code: Select all

<image size="150x50">
nothing changes.

And now a specific question: How do i use the "draw" option in MSL? I tried several ways but get error messages all the time:

Code: Select all

<draw text="Hello World!" />
<draw text="20,20 Hello World!" />
<draw string="text 20,20 Hello World!" />
And i wonder if and how i can use "caption" in MSL ...

User avatar
magick
Site Admin
Posts: 10691
Joined: 2003-05-31T11:32:55-07:00

Re: MSL Documentation/Tutorial?

Post by magick » 2007-09-08T15:05:09-07:00

MSL is modeled after the PerlMagick API. However, as mentioned, some methods and attributes are not yet supported because there has been little demand. Since you asked we added support for the "append" element in ImageMagick 6.3.5-9 Beta (available in 24 hours). Your script should look like this:

Code: Select all

<?xml version="1.0" ?>
<msl>
  <image size='50x50'>
     <read filename='xc:#D33' />
     <read filename='xc:#5A0' />
     <read filename='xc:#29D' />
     <append />
     <display />
  </image>
</msl>

User avatar
magick
Site Admin
Posts: 10691
Joined: 2003-05-31T11:32:55-07:00

Re: MSL Documentation/Tutorial?

Post by magick » 2007-10-12T09:17:26-07:00

We add elements on request. We'll add swap to ImageMagick 6.3.6-2 Beta by tomorrow.

darin

Re: MSL Documentation/Tutorial?

Post by darin » 2010-11-24T10:24:19-07:00

Hi,

I need to determine the number of colors in an image from a web site... Is conjure/MSL the appropriate avenue to do this? What command would i use?

Thanks,
Darin

Post Reply