Well, let me show you what I can do with my newest release of Imarty by doing one step at a time.
This is all the code you need
$imarty = new imarty('imagefile.xml');//get the XML file $imarty->render();//render image $imarty->output_image('gif');//out put gif image
First, let us create a image! Everything below is just changes of the imagefile.xml
<image w="20" h="20" cache=""> </image>
This defines the image's height and width, the cache system does not work yet but it will soon.
Now, add an layer.
<image w="20" h="20" cache=""> <layer w="20" h="20" x="0" y="0" opacity="100" antialias="on"> </layer> </image>
Let's render and see what it looks like now:

Right, boring black, let's add something to it, how about a line!
<image w="20" h="20" cache=""> <layer w="20" h="20" x="0" y="0" opacity="100" antialias="on"> <line x1="1" y1="1" x2="5" y2="5" color="#FFFFFF" /> </layer> </image>

Then, I chose to add a pixel:
<image w="20" h="20" cache=""> <layer w="20" h="20" x="0" y="0" opacity="100" antialias="on"> <line x1="1" y1="1" x2="5" y2="5" color="#FFFFFF" /> <pixel x="10" y="5" color="#FFFFCC" /> </layer> </image>
The result is shown below:

Yes, right, there is NOTHING interesting right now, so that's why I'm drawing a filled circle now:
<image w="20" h="20" cache=""> <layer w="20" h="20" x="0" y="0" opacity="100" antialias="on"> <line x1="1" y1="1" x2="5" y2="5" color="#FFFFFF" /> <pixel x="10" y="5" color="#FFFFCC" /> <ellipse x="10" y="10" w="6" h="6" color="#FF0000" fill="on" /> </layer> </image>
Much better :)

Let's add some filter to it! anyone who uses photoshop will know that filter is the soul of PS:
<image w="20" h="20" cache=""> <layer w="20" h="20" x="0" y="0" opacity="100" antialias="on"> <line x1="1" y1="1" x2="5" y2="5" color="#FFFFFF" /> <pixel x="10" y="5" color="#FFFFCC" /> <ellipse x="10" y="10" w="6" h="6" color="#FF0000" fill="on" /> <filter name="rgb_inverse" /> </layer> </image>
Ok, the image's RGB values is the inverse of the original image.

Finally, I want to cover another layer on top of the original one, and with 50% opacity so what in the background will still be shown. The layer is a gif file:
Here is the image:

<image w="20" h="20" cache=""> <layer w="20" h="20" x="0" y="0" opacity="100" antialias="on"> <line x1="1" y1="1" x2="5" y2="5" color="#FFFFFF" /> <pixel x="10" y="5" color="#FFFFCC" /> <ellipse x="10" y="10" w="6" h="6" color="#FF0000" fill="on" /> <filter name="rgb_inverse" /> </layer> <layer w="20" h="20" x="0" y="0" opacity="50" src="image/smile.gif" /> </image>
The final result

Comments
Post new comment