docs.roxen.comBack to normal mode
DocsRoxenWebServer 5.0Web Developer ManualGraphics Tags
Copyright © 2012, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com

<gxml></gxml>

Provided by module: Graphics: GXML tag

Manipulates images in different ways using layers.

It is possible to make much more advanced manipulation using <gtext></gtext> than with for instance <cimg/>.


Attributes

url

Instead of generating a <img> return the url to the generated image.


noxml

Don't self close the generated <img>.


Timeout

The generated image will by default never expire, but in some circumstances it may be pertinent to limit the time the image and its associated data is kept. Its possible to set an (advisory) timeout on the image data using the following attributes.

unix-time="number"

Set the base expiry time to this absolute time.

If left out, the other attributes are relative to current time.


years="number"

Add this number of years to the time this entry is valid.


months="number"

Add this number of months to the time this entry is valid.


weeks="number"

Add this number of weeks to the time this entry is valid.


days="number"

Add this number of days to the time this entry is valid.


hours="number"

Add this number of hours to the time this entry is valid.


beats="number"

Add this number of beats to the time this entry is valid.


minutes="number"

Add this number of minutes to the time this entry is valid.


seconds="number"

Add this number of seconds to the time this entry is valid.


format="{gif, jpeg, png, avs, gmp, bd, hrz, ilbm, psx, pnm, ps, pvr, tga, tiff, wbf, xbm, xpm}" (gif)

The format to encode the image to. The formats available are:

AcronymAcronym interpretation

gif

Graphics Interchange Format (might be missing in your roxen)

jpeg

Joint Photography Expert Group image compression

png

Portable Networks Graphics

avs

Advanced Visual Systems Inc. image format

bmp

Windows BitMaP file

gd

Internal format used by libgd

hrz

HRZ is (was?) used for amatuer radio slow-scan TV.

ilbm

Interchangeable File Format: interleaved bitmap

pcx

Zsoft PCX file format (PC / DOS)

pnm

Portable AnyMap

ps

Adobe PostScript file

pvr

Pover VR (dreamcast image)

tga

TrueVision Targa (PC / DOS)

tiff

Tag Image File Format

wbf

WAP Bitmap File

xbm

XWindows Bitmap File

xpm

XWindows Pixmap File


quant="number" (format dependant)

The number of colors to quantizize the image to.

Default for gif is 32(+1 transparent), for most other formats (except black and white) is it unlimited.


dither="{none, random, floyd-steinberg}" (none)

Choose the dithering method.

MethodMeaning

none

No dithering is performed at all.

random

Random scatter dither. Not visually pleasing, but it is useful for very high resolution printing.

floyd-steinberg

Error diffusion dithering. Usually the best dithering method.


true-alpha

If present, render a real alpha channel instead of on/off alpha. If the file format only supports on/off alpha, the alpha channel is dithered using a floyd-steinberg dither.


background-color="color" (taken from the page)

The color to render the image against.


opaque-value="percentage" (100)

The transparency value to use, 100 is fully opaque, and 0 is fully transparent.


cs-rgb-hsv="{0, 1}" (0)

Perform rgb to hsv colorspace conversion.


gamma="number" (1.0)

Perform gamma adjustment.


cs-grey="{0, 1}" (0)

Perform rgb to greyscale colorspace conversion.


cs-invert="{0, 1}" (0)

Invert all colors


cs-hsv-rgb="{0, 1}" (0)

Perform hsv to rgb colorspace conversion.


rotate-cw="degree" (0)

Rotate the image clock-wise.


rotate-ccw="degree" (0)

Rotate the image counter clock-wise.


rotate-unit="{rad, deg, ndeg, part}" (deg)

Select the unit to use while rotating.

UnitMeaning

rad

Radians

deg

Degrees

ndeg

'New' degrees (400 for each full rotation)

part

0 - 1.0 (1.0 == full rotation)


mirror-x="{0, 1}" (0)

Mirror the image around the X-axis.


mirror-y="{0, 1}" (0)

Mirror the image around the Y-axis.


scale="fact" (1.0)

Scale fact times. (0.5 -> half size, 2.0 -> double size)


scale="x,y"

Scale to the exact size x,y. If either of X or Y is zero, the image is scaled to the specified width or hight, and the value that is zero is scaled in proportion to the other value.


max-width="xsize"

If width is larger than 'xsize', scale width to 'xsize' while keeping aspect.


max-height="ysize"

If height is larger than 'ysize', scale height to 'ysize' while keeping aspect.


span-width="xsize"

If width is larger than 'xsize', scale width to 'xsize' while keeping aspect. If width is smaller than 'xsize', extend width to 'xsize' by filling the new space with current background color.


span-height="ysize"

If height is larger than 'ysize', scale height to 'ysize' while keeping aspect. If height is smaller than 'ysize', extend height to 'ysize' by filling the new space with current background color.


x-offset="pixels" (0)

Cut n pixels from the beginning of the X scale.


y-offset="pixels" (0)

Cut n pixels from the beginning of the Y scale.


x-size="pixels" (whole image)

Keep n pixels from the beginning of the X scale.


y-size="pixels" (whole image)

Keep n pixels from the beginning of the Y scale.


crop="{x1,y1-x2,y2, auto, guides-cross, guides-region}"

Crops the image by using several differen methods. The simplest is to only specify the area to be cropped with x,y-x,y coordinates. By instead selecting "auto" the image will be cropped so that as many pixels as possible with the same color is removed from around the image.

A more advanced cropping method can be used by giving the crop argument "guides-cross". The image will then be cropped around the intersection of two guides inside the image. Guides can be added to e.g. Photoshop and GIMP images. If several guides are present, which ones to use can be selected with the guides-index=x,y attribute, where x and y is the number of the guides. Guides cross cropping is usefull together with max-width and max-height attributes when creating thumb nails.

A combination of guides cross cropping can be used by giving the crop argument "guides-region". In this cropping mode the area enclosed by two horizontal and two vertical guides are saved. Which guides to use is given by the guides-index=x1,y1-x2,y2 attribute, where the x and y parameters are the number of the guides. Guides can also be specified as guides-index=x,y. Then the saved area will be the one enclosed by the buides x,y and x+1,y+1, counting from left and top. Again, combine max-width and max-height makes a good effect, since scaling is performed after cropping.


jpeg-quality="percentage" (75)

Set the quality on the output jpeg image.


jpeg-optimize="{0, 1}" (1)

If 0, do not generate optimal tables. Somewhat faster, but produces bigger files.


jpeg-progressive=="{0, 1}" (0)

Generate progressive jpeg images.


jpeg-smooth="0-100" (0)

Smooth the image while compressing it. This produces smaller files, but might undo the effects of dithering.


bmp-bpp="1,4,8,24" (24)

Force this number of bits per pixel for bmp images.


bmp-windows="{0, 1}" (1)

Windows or OS/2 mode, default is 1. (windows mode)


bmp-rle="{0, 1}" (0)

RLE 'compress' the BMP image.


gd-alpha_index="color" (0)

Color in the colormap to make transparent for GD-images with alpha channel.


pcx-raw="{1, 0}" (0)

If 1, do not RLE encode the PCX image.


pcx-dpy="0-10000000.0" (75.0)

Resolution, in pixels per inch.


pcx-xdpy="0-10000000.0" (75.0)

Resolution, in pixels per inch.


pcx-ydpy="0-10000000.0" (75.0)

Resolution, in pixels per inch.


pcx-xoffset="0-imagexsize-2" (0)

Offset from start of image data to image content for PCX images. Unused by most programs.


pcx-yoffset="0-imageysize-2" (0)

Offset from start of image data to image content for PCX images. Unused by most programs.


tga-raw="{1, 0}" (0)

If 1, do not RLE encode the Targa image.


ps-dpi="0-10000000.0" (75.0)

Dots per inch for the resulting postscript file.


&_.layers.{name}.; (provided by Graphics: GXML tag)

Height of layer name.


&_.layers.{name}.; (provided by Graphics: GXML tag)

Width of the layer name.


&_.layers.{name}.l; (provided by Graphics: GXML tag)

Position of the left side of the layer name.


&_.layers.{name}.t; (provided by Graphics: GXML tag)

Position of the top side of the layer name.


<blur/> or <blur></blur>

Provided by module: Graphics: GXML tag

Blur either the specified layers.

<gxml format='jpg'> <load-image src='/internal-roxen-testimage' /> <move-layer x='&_.layers.Background.w;' absolute=''> <blur> <load-image src='/internal-roxen-testimage' /> </blur> </move-layer> <move-layer x='&_.layers.Background.w;*2' absolute=''> <blur radius='5' times='2'> <load-image src='/internal-roxen-testimage' /> </blur> </move-layer> </gxml>

Attributes

layers="glob"

Layer to blur.


layers-id="layer-id"

Layer to blur.


radius="r" (3)

Set radius r for the blur. The default value is optimized and thus significantly faster than the other cases.


times="n" (1)

Blur the image n number of times.


what="{image, alpha}" (image)

Set what to 'alpha' if you want to blur the alpha channel.


<clear/> or <clear></clear>

Provided by module: Graphics: GXML tag

Clear layer to a given color.


Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


color="color" (black)

Color to clear layer to.


<color/> or <color></color>

Provided by module: Graphics: GXML tag

Clear layer to a given color.

<gxml format='jpeg'> <color color='#FF0077'> <load-image src='/internal-roxen-testimage' /> </color> </gxml>

Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


color="color" (black)

Color to colorize image with.


<color-distance/> or <color-distance></color-distance>

Provided by module: Graphics: GXML tag

Makes an grey-scale image, for alpha-channel use.

The given value (or current color) is used for coordinates in the color cube. Each resulting pixel is the distance from this point to the source pixel color, in the color cube, squared, rightshifted 8 steps:

p - pixel color o - given color d - destination pixel d.red=d.blue=d.green=((o.red-p.red)²+(o.green-p.green)²+(o.blue-p.blue)²)>>8
<gxml format='jpeg'> <load-image src='/internal-roxen-testimage' /> <text color='white'>Original</text> </gxml> <gxml format='jpeg'> <color-distance color='red'> <load-image src='/internal-roxen-testimage'/> </color-distance> <text color='white'>Red</text> </gxml> <gxml format='jpeg'> <color-distance color='green'> <load-image src='/internal-roxen-testimage' /> </color-distance> <text color='black'>Green</text> </gxml> <gxml format='jpeg'> <color-distance color='blue'> <load-image src='/internal-roxen-testimage' /> </color-distance> <text color='black'>Blue</text> </gxml>

Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


<coordinate-system></coordinate-system>

Provided by module: Graphics: GXML tag

Draws a coordinate system that can be used to make your own diagrams.

<gxml format='png' true-alpha='' size='layers(coordinate-system*)'> <new-layer color='white' xsize='32' ysize='32' tiled='1' /> <shadow layers='coordinate-system*' soft='1'> <coordinate-system xsize='700' ysize='500' color='black'> <data> <y start='1.0' end='2.0'> <labels start='1.0' end='2.1' step='0.2' format='%2.1f' font='Haru' fontsize='12' /> <labels start='1.1' end='2.1' step='0.2' format='%2.1f' font='Haru' fontsize='9' /> <ticks start='1.0' end='2.0' step='0.01' width='1' length='6' /> <ticks start='1.0' end='2.0' step='0.1' width='1' length='8' /> <ticks start='1.0' end='2.1' step='0.2' width='2' length='10' /> </y> <x start='1992' end='2001'> <labels start='1992' end='2000' step='1' format='%d' font='Haru' fontsize='12' /> <ticks start='1992' end='2001.1' step='1/12' width='1' length='6' /> <ticks start='1992' end='2001.1' step='1/3' width='1' length='8' /> <ticks start='1992' end='2001.1' step='1' width='2' length='10' /> </x> <frame color='darkred' width='2' /> </data> <shadow soft='3' xoffse='1' yoffset='3'> <line color='orange' xsize='700' ysize='500' width='4' coordinate-system='1992,1.0-2001,2.0'> <c x='1992' y='1.0' /> <c x='1994' y='1.8' /> <c x='2000.5' y='1.2' /> </line> <line color='red' xsize='700' ysize='500' width='4' coordinate-system='1992,1.0-2001,2.0'> <c x='1992' y='1.5' /> <c x='1994' y='1.6' /> <c x='2000.5' y='1.8' /> </line> <line color='darkgreen' xsize='700' ysize='500' width='4' coordinate-system='1992,1.0-2001,2.0'> <c x='1992' y='1.8' /> <c x='1998' y='1.0' /> <c x='2000.5' y='1.8' /> </line> </shadow> <shadow soft='6'> <legend fontsize='12' border='black' bgcolor='white' fgcolor='black' background='100%' square-border='black' font='Haru'> <label color='orange'>Sugar</label> <label color='red'>Spice</label> <label color='darkgreen'>Everything nice</label> </legend> </shadow> </coordinate-system></shadow> </gxml>

Attributes

xsize="width in pixels"

Width of the generated image.


ysize="height in pixels"

Height of the generated image.


color="color" (black)

Set the color for coordinate system and its labels.

<gxml> <new-layer color='white' xsize='32' ysize='32' tiled='1' /> <coordinate-system xsize='30' ysize='30'> <data> <y start='0.0' end='2.0'> <labels start='0.0' end='2.0' step='1' fontsize='10' format='%1.1f'/> <ticks start='0.0' end='2.1' step='1' width='1' length='4' /> </y> <x start='0.0' end='2.0'> <labels start='0.0' end='2.0' step='1' fontsize='10' format='%d'/> <ticks start='0.0' end='2.1' step='1' width='1' length='4' /> </x> <frame width='2' /> </data> </coordinate-system> </gxml>

mode="mode" (normal)

Sets the mode for the new layer. See <set-layer-mode>.


<data></data>

Provided by module: Graphics: GXML tag

Used for tags used to describe the coordinate system.


<frame/>

Provided by module: Graphics: GXML tag

Draw a frame for the coordinate system.

<gxml format='png' true-alpha='1'> <new-layer xsize='32' ysize='32' color='white' tiled='1' /> <coordinate-system xsize='200' ysize='100' transparent='1' > <data> <frame width='1' color='darkblue' /> <y start='1' end='16' /> </data> </coordinate-system> </gxml>

Attributes

width="width in pixels" (2)

Width of the frame.


color="color"

Color of the frame.


name="name of the layer" (coordinate-system.frame)

Name of the new layer that frame is drawn in.


mode="layer mode"

Sets the layer mode.


<x></x>

Provided by module: Graphics: GXML tag

Contains tags about how to draw the x-axis.


Attributes

start="number" (0)

Start of the x-axis.


end="number" (1)

End of the x-axis.


<labels/> or <labels></labels>

Provided by module: Graphics: GXML tag

Labels to put along the x axis. You can either set all your labels yourself in the tag content separated by newlines. The first label will be put at the position of start and then use step to calculate the subsequent positions until end is reached.

If you don't want to explicitly write all your labels yourself then you can use format to automatically generate labels.

<gxml format='png' true-alpha='1'> <new-layer color='white' xsize='32' ysize='32' tiled='1' /> <coordinate-system xsize='400' ysize='300' transparent='1' fontsize='12' font='Haru'> <data> <x start='0' end='6'> <labels start='0.5' end='4.5' step='1' rotate='90'> Hokkaido Nippon Ham Fighters Fukuoka Softbank Hawks Tohoku Rakuten Golden Eagles Saitama Seibu Lions Orix Buffaloes </labels> <labels start='5.5' end='6' step='1' color='red' rotate='90'> Chiba Lotte Marines </labels> </x> <y start='1' end='16'> <labels start='1' end='16' step='1' format='%1.2f' /> </y> <frame width='2' /> </data> </coordinate-system> </gxml>

Attributes

start="number"

The first number in the sequence of labels along the x-axis.


end="number"

The last number in the sequense of labels along the x-axis.


step="number"

How many steps to do between each number.


format="sprintf format"

This sets how the generated labels should be outputted. It is possible to set how many digits should be used and even if you want the output to be hexadecimal, octal or binary. The format used is the same as used by <sprintf>

This attribute is required if no content is given to <labels>.

<gxml format='png' true-alpha='1'> <new-layer color='white' xsize='32' ysize='32' tiled='1' /> <coordinate-system xsize='500' ysize='200' font='haru' fontsize='10'> <data> <frame width='2' /> <x start='0' end='16'> <labels start='1' end='16' step='1' format='0x%02X' /> </x> <y start='0' end='100'> <labels start='0' end='100' step='20' format='%d %%' /> </y> </data> </coordinate-system> </gxml>

font="font"

Font to use for the labels.


fontsize="fontsize"

Fontsize.


rotate="degree"

Rotate the the label this much.


color="color"

Color of the labels.


<ticks/>

Provided by module: Graphics: GXML tag

Draw lines that denote the scale. This tag works in much the same way as <labels>.

<gxml format='png' true-alpha='1'> <new-layer color='white' xsize='32' ysize='32' tiled='1'/> <coordinate-system xsize='400' ysize='300' transparent='1'> <data> <x start='0' end='100'> <ticks start='1' end='100' step='1' width='1' length='6' /> <ticks start='10' end='101' step='10' width='2' length='10' /> </x> <y start='1' end='16'> <ticks start='1' end='16' step='1' width='1' length='6' /> </y> <frame width='2' /> </data> </coordinate-system> </gxml>

Attributes

start="number"

The first position to draw a marker on.


end="number"

The last position to draw markers.


step="number"

How many steps between each marker.


width="width in pixels"

Thickness of the marker.


lenght="lenght in pixels"

Lenght of the marker.


<y></y>

Provided by module: Graphics: GXML tag

Contains tags about how to draw the y-axis.


Attributes

start="number" (0)

Start of the y-axis.


end="number" (1)

End of the y-axis.


<labels/> or <labels></labels>

Provided by module: Graphics: GXML tag

Labels to put along the y-axis. This tag works the same as the corresponding tag for <x>.


Attributes

start="number"

The first number in the sequence of labels along the y-axis.


end="number"

The last number in the sequense of labels along the y-axis.


step="number"

How many steps to do between each number.


format="sprintf format"

This sets how the generated labels should be outputted. It is possible to set how many digits should be used. The format used is the same as used by <sprintf>

This attribute is required if no content is given to <labels>.


font="font"

Font to use for the labels.


fontsize="fontsize"

Fontsize.


rotate="degree"

Rotate the the label this much.


color="color"

Color of the labels.


<ticks/>

Provided by module: Graphics: GXML tag

Draw lines that denote the scale. This tag works in much the same way as <labels>.


Attributes

start="number"

The first position to draw a marker on.


end="number"

The last position to draw markers.


step="number"

How many steps between each marker.


width="width in pixels"

Thickness of the marker.


lenght="lenght in pixels"

Lenght of the marker.


<crop/> or <crop></crop>

Provided by module: Graphics: GXML tag

Crop the specified layer(s).

<gxml> <crop x='25' y='50' width='100' height='100'> <load-image src='/internal-roxen-testimage' /> </crop> </gxml>

Attributes

layers="glob"

Layer to crop.


layers-id="layer-id"

Layer to crop.


x="number"

How far from the left the layer should be cropped.


y="number"

How far from the top the layer should be cropped.


width="number"

Width of the cropped layer.


height="number"

Height of the cropped layer.


<expand/> or <expand></expand>

Provided by module: Graphics: GXML tag

Expand the layer(s) to the size of the whole image.


Attributes

layers="glob"

Layer to expand.


layers-id="layers-id"

Layers to expand.


<gamma/> or <gamma></gamma>

Provided by module: Graphics: GXML tag

Adjust the gamma of a layer.


Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


gamma

what

Whether to work on the alpha channels or image data or both.


<grey/> or <grey></grey>

Provided by module: Graphics: GXML tag

Make the layer greyscale.

<gxml format='jpeg'> <grey> <load-image src='/internal-roxen-testimage' /> </grey> </gxml>

Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


<grey-blur/> or <grey-blur></grey-blur>

Provided by module: Graphics: GXML tag

Same as <blur> but up to three times faster. Works only for greyscale images though.


Attributes

layers="glob"

Layer to blur.


layers-id="layer-id"

Layer to blur.


times="number" (1)

Number of times to blur the image.


what="{image, alpha}" (image)

Set what to 'alpha' if you want to blur the alpha channel.


<hsv-to-rgb/> or <hsv-to-rgb></hsv-to-rgb>

Provided by module: Graphics: GXML tag

Convert layer from HSV to RGB color model.
<gxml format='jpg'> <load-image src='/internal-roxen-testimage' /> <text color='white'>Original</text> <move-layer x='&_.layers.Background.w;'> <hsv-to-rgb> <load-image src='/internal-roxen-testimage'/> </hsv-to-rgb> <text color='white'>HSV to RGB</text> </move-layer> <move-layer x='&_.layers.Background.w;*2'> <rgb-to-hsv> <load-image src='/internal-roxen-testimage' /> </rgb-to-hsv> <text color='white'>RGB to HSV</text> </move-layer> </gxml>


Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


<invert/> or <invert></invert>

Provided by module: Graphics: GXML tag

Invert the colors and/or alpha of a layer.

<gxml format='jpeg'> <invert> <load-image src='/internal-roxen-testimage' /> </invert> </gxml>

Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


<legend></legend>

Provided by module: Graphics: GXML tag

This tag draws a legend which could be useful e.g. when drawing diagrams.

<gxml format='png' true-alpha='1'> <shadow soft='6'> <legend fontsize='12' border='black' bgcolor='white' fgcolor='black' background='100%' square-border='black' font='Haru'> <label color='lightblue'>Mac OS X</label> <label color='red'>Red Hat Enterprise Linux</label> <label color='darkblue'>Solaris</label> <label color='green'>Windows</label> </legend> </shadow> </gxml>

Attributes

columns="positive integer" (2)

How many columns to use in the legend.


bgcolor="color" (white)

Background color.


fgcolor="color" (black)

Text and border color.


font="font name"

Font to use.


fontsize="fontsize"

Fontsize.


square-border="color"

Color of the border around each color key in the legend.


border="color"

Draws a border around the legend in the given color.


background="percent"

Sets opacity of the legend.

<gxml format='png' true-alpha='1'> <load-image src='/internal-roxen-squares' tiled='1'/> <shadow soft='5' color='white'> <legend fontsize='12' border='black' bgcolor='white' text='black' fgcolor='red' background='60%' font='Haru' > <label color='lightblue'>Mac OS X</label> <label color='red'>Red Hat Enterprise Linux</label> <label color='darkblue'>Solaris</label> <label color='green'>Windows</label> </legend> </shadow> </gxml>

name="string" (values)

Set this name of the new layer.


<label></label>

Provided by module: Graphics: GXML tag

Defines a key in the legend.


Attributes

color

Color of the key.


<line></line>

Provided by module: Graphics: GXML tag

Draws a line, either as a new layer or by modifying the alpha of the given layer(s).

<gxml format='png' true-alpha=''> <shadow soft='10'> <line xsize='152' ysize='127' color='orange' width='3'> <c x='1' y='1' /> <c x='151' y='1' /> <c x='151' y='81' /> <c x='111' y='81' /> <c x='111' y='126' /> <c x='76' y='126' /> <c x='76' y='81' /> <c x='66' y='81' /> <c x='66' y='51' /> <c x='111' y='51' /> <c x='111' y='31' /> <c x='41' y='31' /> <c x='41' y='126' /> <c x='1' y='126' /> <c x='1' y='1' /> </line> <line xsize='152' ysize='127' color='orange' width='3'> <c x='136' y='111' /> <c x='151' y='111' /> <c x='151' y='126' /> <c x='136' y='126' /> <c x='136' y='111' /> </line> </shadow> </gxml>

Attributes

layers="glob"

Layer to work on.


layers-id="layers-id"

Layer to work on.


name="string"

Name of the new layer, if a new layer is created.


coordinate-system="x0,y0-x1,y1"

Sets up a coordinate system of the same size as the layer it will apply to. This is useful e.g. if you want to draw graphs

<gxml format='png' true-alpha=''> <shadow soft='10'> <line color='red' width='3' xsize='600' ysize='150' coordinate-system='2000,0.0-2010,2.0'> <c x='2000' y='1.2' /> <c x='2001' y='1.8' /> <c x='2002' y='0.8' /> <c x='2003' y='0.003' /> <c x='2004' y='0.3' /> <c x='2005' y='0.5' /> <c x='2006' y='1.0' /> <c x='2007' y='0.8' /> <c x='2008' y='1.3' /> <c x='2009' y='1.8' /> <c x='2010' y='2.7' /> </line> </shadow> </gxml>

xsize="width in pixels"

Width of the new layer, if a new layer is created.


ysize="height in pixels"

Height of the new layer, if a new layer is created.


xoffset="px"

yoffset="px"

color="color"

Color of the new line.


cap="{butt, projecting, round}" (butt)

Choose which "cap" to use when drawing the line. This will what the ends of the line will look like.

<gxml format='png' true-alpha='1'> <text fontsize='10' x='5' y='3'>Butt:</text> <line xsize='220' ysize='120' width='20' cap='butt' color='red'> <c x='15' y='25' /> <c x='205' y='25' /> </line> <line xsize='220' ysize='120' width='1' color='black'> <c x='15' y='25' /> <c x='205' y='25' /> </line> <text fontsize='10' x='5' y='38'>Projecting:</text> <line xsize='320' ysize='120' width='20' cap='projecting' color='green'> <c x='15' y='60' /> <c x='205' y='60' /> </line> <line xsize='220' ysize='120' width='1' color='black'> <c x='15' y='60' /> <c x='205' y='60' /> </line> <text fontsize='10' x='5' y='73'>Round:</text> <line xsize='220' ysize='120' width='20' cap='round' color='blue'> <c x='15' y='95' /> <c x='205' y='95' /> </line> <line xsize='220' ysize='120' width='1' color='white'> <c x='15' y='95' /> <c x='205' y='95' /> </line> </gxml>

join="{bevel, miter, round}" (miter)

How to join several connected lines.

<gxml format='png' true-alpha='1'> <text fontsize='10' x='5' y='3'>Bevel:</text> <line xsize='80' ysize='80' width='20' join='bevel' cap='round' color='red'> <c x='20' y='30' /> <c x='50' y='30' /> <c x='50' y='60' /> </line> <move-layer x='80' absolute=''> <text fontsize='10' x='5' y='3'>Miter:</text> <line xsize='80' ysize='80' width='20' join='miter' cap='round' color='green'> <c x='20' y='30' /> <c x='50' y='30' /> <c x='50' y='60' /> </line> </move-layer> <move-layer x='160' absolute=''> <text fontsize='10' x='5' y='3'>Round:</text> <line xsize='80' ysize='80' width='20' join='round' cap='round' color='blue'> <c x='20' y='30' /> <c x='50' y='30' /> <c x='50' y='60' /> </line> </move-layer> </gxml>

opacity="percent"

Opacity of the line. Will not be less than base-opacity.


base-opacity="percent"

Opacity for the whole layer.


<c/>

Provided by module: Graphics: GXML tag

Coordinate of a point in the line.


Attributes

x="number"

y="number"

<load-image/>

Provided by module: Graphics: GXML tag

Load an image from disk.


Attributes

src="url"

The path to the indata file.


tile

If the layer which the image is loaded into is larger than the image itself then tile the image.


<mirror-x/> or <mirror-x></mirror-x>

Provided by module: Graphics: GXML tag

Mirror layer along the X-axis.


Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


<mirror-y/> or <mirror-y></mirror-y>

Provided by module: Graphics: GXML tag

Mirror layer along the Y-axis.


Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


<move-layer/> or <move-layer></move-layer>

Provided by module: Graphics: GXML tag

Moves the specified layer(s).


Attributes

layers="glob"

Layer to be moved.


layers-id="layer-id"

Layer to be moved.


x="number"

Move the layer along the x-axis.


y="number"

Move the layer along the y-axis.


absolute

If this attribute is set then x and y will be absolute coordinates instead of relative.


<new-layer/>

Provided by module: Graphics: GXML tag

Create a new empty layer.


Attributes

xsize

Width of layer.


ysize

Height of layer.


color="color" (black)

transparent

If the layer should be fully transparent. Default is a fully opaque layer.


mode="mode" (normal)

Sets the mode for the new layer. See <set-layer-mode>.


<poly></poly>

Provided by module: Graphics: GXML tag

Creates a polygone, either as a new layer or by modifying the alpha of the given layer(s).

<gxml format='png' true-alpha=''> <shadow soft='10'> <poly layers='*'> <c x='&_.layers.Background.w;/2' y='0' /> <c x='&_.layers.Background.w;' y='&_.layers.Background.h;/2' /> <c x='&_.layers.Background.w;/2' y='&_.layers.Background.h;' /> <c x='0' y='&_.layers.Background.h;/2' /> <load-image src='/internal-roxen-testimage' /> </poly> </shadow> </gxml>

Attributes

layers="glob"

Layer to work on.


layers-id="layers-id"

Layer to work on.


name="string"

Name of the new layer, if a new layer is created.


coordinate-system="x0,y0-x1,y1"

Sets up a coordinate system of the same size as the layer it will apply to.

<gxml format='png' true-alpha=''> <shadow soft='10'> <poly xsize='150' ysize='115' color='orange' coordinate-system='0,0-3,2.5'> <c x='0' y='2.5' /> <c x='3' y='2.5' /> <c x='3' y='0.9' /> <c x='2.2' y='0.9' /> <c x='2.2' y='0' /> <c x='1.5' y='0' /> <c x='1.5' y='0.9' /> <c x='1.3' y='0.9' /> <c x='1.3' y='1.5' /> <c x='2.2' y='1.5' /> <c x='2.2' y='1.9' /> <c x='0.8' y='1.9' /> <c x='0.8' y='0' /> <c x='0' y='0' /> </poly> <move-layer x='135' y='100'> <poly xsize='15' ysize='15' color='orange' coordinate-system='0,0-1,1'> <c x='0' y='0' /> <c x='1' y='0' /> <c x='1' y='1' /> <c x='0' y='1' /> </poly> </move-layer> </shadow> </gxml>

xsize="width in pixels"

Width of the new layer, if a new layer is created.


ysize="height in pixels"

Height of the new layer, if a new layer is created.


xoffset="px"

yoffset="px"

color="color"

Color of the new polygon.


opacity="percent"

Opacity of the polygon. Will not be less than base-opacity.


base-opacity="percent"

Opacity for the whole layer.


<c/>

Provided by module: Graphics: GXML tag

Coordinate of a vertex in the polygon.


Attributes

x="number"

y="number"

<replace-alpha/> or <replace-alpha></replace-alpha>

Provided by module: Graphics: GXML tag

Replace the alpha channel of the specified layer(s) with either the alpha channel from another layer or a group of layers or a color.


Attributes

layers="glob"

Layer to replace alpha.


layers-id="layer-id"

Layer to replace alpha.


from="layer"

Layer to copy alpha channel from.


from-id="layer-id"

Layer to copy alpha channel from.


color="color"

Create alpha channel from the given color in the layer.


<rgb-to-hsv/> or <rgb-to-hsv></rgb-to-hsv>

Provided by module: Graphics: GXML tag

Convert layer from RGB to HSV color model.
<gxml format='jpg'> <load-image src='/internal-roxen-testimage' /> <text color='white'>Original</text> <move-layer x='&_.layers.Background.w;'> <hsv-to-rgb> <load-image src='/internal-roxen-testimage'/> </hsv-to-rgb> <text color='white'>HSV to RGB</text> </move-layer> <move-layer x='&_.layers.Background.w;*2'> <rgb-to-hsv> <load-image src='/internal-roxen-testimage' /> </rgb-to-hsv> <text color='white'>RGB to HSV</text> </move-layer> </gxml>


Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


<rotate/> or <rotate></rotate>

Provided by module: Graphics: GXML tag

Rotate the specified layer(s)


Attributes

layers="glob"

Layer to rotate


layers-id="layer-id"

Layer to rotate


degrees="degrees"

Number of degrees to rotate the layer(s)


<scale/> or <scale></scale>

Provided by module: Graphics: GXML tag

Scale the specified layer(s).


Attributes

layers="glob"

Layer to scale.


layers-id="layer-id"

Layer to scale.


mode="{absolute, relative}" (absolute)

If mode is set to "relative", the width and height will be given as percentages of the original width and height.


width="{pixels, percentage}"

Set the width of the scaled layer. If height is not set or set to 0, the aspect ratio will be perserved.


height="{pixels, percentage}"

Set the height of the scaled layer. If width is not set or set to 0, the aspect ratio will be perserved.


max-width="xsize"

If height is larger than 'ysize', scale height to 'ysize' while keeping aspect.


max-height="ysize"

If height is larger than 'ysize', scale height to 'ysize' while keeping aspect.


<select-from/> or <select-from></select-from>

Provided by module: Graphics: GXML tag

Makes an grey-scale image, for alpha-channel use.

This is very close to a floodfill.

<gxml format='png' true-alpha=''> <load-image src='/internal-roxen-testimage' /> <set-layer-mode mode='multiply'> <select-from x='200' y='100' edge-value='150' what='image'> <load-image src='/internal-roxen-testimage' /> </select-from> </set-layer-mode> </gxml>

Attributes

layers="glob"

Layer to work on


layers-id="layers-id"

Layer to work on


what

Whether to work on the alpha channels or image data or both.


x="number"

y="number"

Originating pixel in the image


edge-value="{0-255}" (30)

Tolerance level of how much the current pixels color may different from the originating pixel's.


<select-layers/>

Provided by module: Graphics: GXML tag

Select a list of layers to be rendered.


Attributes

include="glob"

include-id="layer-id"

exclude="glob"

exclude-id="layer-id"

<set-layer-mode/> or <set-layer-mode></set-layer-mode>

Provided by module: Graphics: GXML tag

Set layer mode.


Attributes

mode="mode" (normal)

Mode is one of these:

variableMeaning

L

The active layer

S

The source layer (the sum of the layers below)

D

The destintion layer (the result)

Xrgb

Layer red (Xr), green (Xg) or blue channel (Xb)

Xhsv

Layer hue (Xh), saturation (Xs) or value channel (Xv) (virtual channels)

Xhls

Layer hue (Xh), lightness channel (Xl) or saturation (Xs) (virtual channels)

aX

Layer alpha, channel in layer alpha

All channels are calculated separately, if nothing else is specified.

Bottom layer:

Top layer:

normal

D=L applied with alpha: D=(L*aL+S*(1-aL)*aS) / (aL+(1-aL)*aS), aD=(aL+(1-aL)*aS)

add

D=L+S applied with alpha, aD=aS

subtract

D=S-L applied with alpha, aD=aS

multiply

D=S*L applied with alpha, aD=aS

divide

D=S/L applied with alpha, aD=aS

negdivide

D=1.0-S/L applied with alpha, aD=aS

modulo

D=S%L applied with alpha, aD=aS

invsubtract

D=L-S applied with alpha, aD=aS

invdivide

D=L/S applied with alpha, aD=aS

invmodulo

D=L%S applied with alpha, aD=aS

imultiply

D=(1-L)*S applied with alpha, aD=aS

idivide

D=S/(1-L) applied with alpha, aD=aS

invidivide

D=L/(1-S) applied with alpha, aD=aS

difference

D=abs(L-S) applied with alpha, aD=aS

max

D=max(L,S) applied with alpha, aD=aS

min

D=min(L,S) applied with alpha, aD=aS

bitwise_and

D=L&S applied with alpha, aD=aS

bitwise_or

D=L|S applied with alpha, aD=aS

bitwise_xor

D=L^S applied with alpha, aD=aS

replace

D=(L*aL+S*(1-aL)*aS) / (aL+(1-aL)*aS), aD=aS

red

Dr=(Lr*aLr+Sr*(1-aLr)*aSr) / (aLr+(1-aLr)*aSr), Dgb=Sgb, aD=aS

green

Dg=(Lg*aLg+Sg*(1-aLg)*aSg) / (aLg+(1-aLg)*aSg), Drb=Srb, aD=aS

blue

Db=(Lb*aLb+Sb*(1-aLb)*aSb) / (aLb+(1-aLb)*aSb), Drg=Srg, aD=aS

hardlight

Like photoshop hardlight layer mode, aD=aS

replace_hsv

Dhsv=Lhsv apply with alpha, aD=aS

hue

Dh=Lh apply with alpha, Dsv=Lsv, aD=aS

saturation

Ds=Ls apply with alpha, Dhv=Lhv, aD=aS

value

Dv=Lv apply with alpha, Dhs=Lhs, aD=aS

color

Dhs=Lhs apply with alpha, Dv=Lv, aD=aS

value_mul

Dv=Lv*Sv apply with alpha, Dhs=Lhs, aD=aS

darken

Dv=min(Lv,Sv) apply with alpha, Dhs=Lhs, aD=aS

lighten

Dv=max(Lv,Sv) apply with alpha, Dhs=Lhs, aD=aS

saturate

Ds=max(Ls,Ss) apply with alpha, Dhv=Lhv, aD=aS

desaturate

Ds=min(Ls,Ss) apply with alpha, Dhv=Lhv, aD=aS

hls_replace

Dhls=Lhls apply with alpha, aD=aS

hls_hue

Dh=Lh apply with alpha, Dsv=Lsv, aD=aS

hls_saturation

Ds=Ls apply with alpha, Dhv=Lhv, aD=aS

hls_lightness

Dl=Ll apply with alpha, Dhs=Lhs, aD=aS

hls_color

Dhs=Lhs apply with alpha, Dl=Ll, aD=aS

hls_lightness_mul

Dl=Ll*Sl apply with alpha, Dhs=Lhs, aD=aS

hls_darken

Dl=min(Ll,Sl) apply with alpha, Dhs=Lhs, aD=aS

hls_lighten

Dl=max(Ll,Sl) apply with alpha, Dhs=Lhs, aD=aS

hls_saturate

Ds=max(Ls,Ss) apply with alpha, Dhl=Lhl, aD=aS

hls_desaturate

Ds=min(Ls,Ss) apply with alpha, Dhl=Lhl, aD=aS

dissolve

i=random 0 or 1, D=i?L:S, aD=i+aS

behind

D=(S*aS+L*(1-aS)*aL) / (aS+(1-aS)*aL), aD=(aS+(1-aS)*aL); simply swap S and L

erase

D=S, aD=aS*(1-aL)

screen

1-(1-S)*(1-L) applied with alpha, aD=aS

overlay

(1-(1-a)*(1-b)-a*b)*a+a*b applied with alpha, aD=aS

burn_alpha

aD=aL+aS applied with alpha, D=L+S; experimental, may change or be removed

equal

each channel D=max if L==S, 0 otherwise, apply with alpha

not_equal

each channel D=max if L!=S, 0 otherwise, apply with alpha

less

each channel D=max if L<S, 0 otherwise, apply with alpha

more

each channel D=max if L>S, 0 otherwise, apply with alpha

less_or_equal

each channel D=max if L<=S, 0 otherwise, apply with alpha

more_or_equal

each channel D=max if L>=S, 0 otherwise, apply with alpha

logic_equal

logic: D=white and opaque if L==S, black and transparent otherwise

logic_not_equal

logic: D=white and opaque if any L!=S, black and transparent otherwise

logic_strict_less

logic: D=white and opaque if all L<S, black and transparent otherwise

logic_strict_more

logic: D=white and opaque if all L>S, black and transparent otherwise

logic_strict_less_equal

logic: D=white and opaque if all L<=L, black and transparent otherwise

logic_strict_more_equal

logic: D=white and opaque if all L>=L, black and transparent otherwise


<shadow/> or <shadow></shadow>

Provided by module: Graphics: GXML tag

Creates a new layer which contains the shadow of the specified layers.

<gxml format='png' true-alpha='1' background-color='white'> <shadow xoffset='3' yoffset='3' soft='3' color='blue'> <text name='foo' color='white'>Hello World!</text> </shadow> </gxml>

Attributes

layers="glob"

Layer to create shadow for.


layers-id="layer-id"

Layer to create shadow for.


xoffset="number"

How much to the right of the specified layer the shadow will fall.


yoffset="number"

How much below the specified layer the shadow will fall.


soft="number"

How blurred the shadow should be.


color="color"

Color of the shadow.


<text></text>

Provided by module: Graphics: GXML tag

Render text onto the specified layer or, if no layer is specified, onto a new layer.


Attributes

layers-id="layer-id"

Layer to render the text to.


layers="glob"

Layer to render the text to.


name="string"

Name of the new layer.


font="string"

Selects which font to use. You can get a list of all available fonts by using the list fonts task in the administration interface, or by using the <emit fonts> plugin.


fontsize="number"

Selects which size of the font that should be used.


color="color"

Sets the text color.


x="number"

y="number"

modulate-alpha

The text will be used to modulate the alpha channel of the specified layer.


replace-alpha

Almost the same as the modulate-alpha attribute but replaces the whole alpha channel of the specified layer.