is MSL dead? and a feature request

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
pooco

is MSL dead? and a feature request

Post by pooco »

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"
from here
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: is MSL dead? and a feature request

Post by magick »

MSL is not dead. It is actively supported.

MSL variables are simply image properties. Depending on your interface method set the property. From the command line, for example, you use -define (e.g. -define dimensions="400x400").
pooco

Re: is MSL dead? and a feature request

Post by pooco »

interesting. so how would one define an arbitrary text string on the commandline and pass that into the MSL?

define text1="xxxxxxxxxxxxx" ?

<draw text="%text1" /> ?

are there any simplistic examples anywhere of drawing a couple different lines of text on an image via any method?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: is MSL dead? and a feature request

Post by magick »

Here is a simple annotation example:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<image size="400x400">
    <read filename="xc:white" />
    <annotate pointsize="48" x="20" y="200" text="%[text]" />
    <write filename="image.png" />
</image>
Save as annotate.msl and use these commands:
  • conjure -text ImageMagick annotate.msl
    display image.png
pooco

Re: is MSL dead? and a feature request

Post by pooco »

got it, thank you very much!

we're having trouble translating the API techniques to an MSL file. it looks as though the method support is pretty haphazard?

for the moment, we're trying to create this:
text layer 1
text layer 1's drop shadow

text layer 2
text layer 2's drop shadow

background image
is this possible with MSL in its current state?

what i'm working with right now is:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<group>
	<image id="text1_shadow" size="300x75">
		<read filename="xc:transparent" />
		<annotate pointsize="48" x="22" y="52" fill="darkcyan" text="Hello" />
		<blur geometry="2x2" radius="20" />
	</image>
	<image id="text2_shadow" size="300x75">
		<read filename="xc:transparent" />
		<annotate pointsize="28" x="200" y="55" fill="transparent" stroke="white" strokewidth="2" text="there" />
		<blur geometry="2x2" radius="20" />
	</image>
	<image id="text1_fore" size="300x75">
		<read filename="xc:transparent" />
		<annotate pointsize="48" x="20" y="50" fill="white" text="Hello" />
	</image>
	<image id="text2_fore" size="300x75">
		<read filename="xc:transparent" />
		<annotate pointsize="28" x="200" y="55" fill="darkcyan" text="there" />
	</image>
	<image>
		<read filename="gradient:lightcyan-skyblue" />
		<composite image="text1_shadow" />
		<composite image="text1_fore" />
		<composite image="text2_shadow" />
		<composite image="text2_fore" />
	</image>
	<write filename="image.png" />
</group> 
Post Reply