d246d82000-06-01Martin Nilsson <h2>Image cache attributes</h2>
9b03652001-03-07Kenneth Johansson <attr name='format' value='gif|jpeg|png|avs|gmp|bd|hrz|ilbm|psx|pnm|ps|pvr|tga|tiff|wbf|xbm|xpm' default='gif'><p> The format to encode the image to. The formats available are:</p> <xtable>
d8c3322001-04-09Kenneth Johansson <row><h>Acronym</h><h>Acronym interpretation</h></row> <row><c><p>gif</p></c><c><p>Graphics Interchange Format (might be missing in your roxen)</p></c></row> <row><c><p>jpeg</p></c><c><p>Joint Photography Expert Group image compression</p></c></row> <row><c><p>png</p></c><c><p>Portable Networks Graphics</p></c></row>
782f2b2001-04-09Kenneth Johansson <row><c><p>avs</p></c><c><p>Advanced Visual Systems Inc. image format</p></c></row>
d8c3322001-04-09Kenneth Johansson <row><c><p>bmp</p></c><c><p>Windows BitMaP file</p></c></row>
782f2b2001-04-09Kenneth Johansson <row><c><p>gd</p></c><c><p>Internal format used by libgd</p></c></row>
d8c3322001-04-09Kenneth Johansson <row><c><p>hrz</p></c><c><p>HRZ is (was?) used for amatuer radio slow-scan TV.</p></c></row> <row><c><p>ilbm</p></c><c><p>Interchangeable File Format: interleaved bitmap</p></c></row> <row><c><p>pcx</p></c><c><p>Zsoft PCX file format (PC / DOS)</p></c></row> <row><c><p>pnm</p></c><c><p>Portable AnyMap</p></c></row> <row><c><p>ps</p></c><c><p>Adobe PostScript file</p></c></row> <row><c><p>pvr</p></c><c><p>Pover VR (dreamcast image)</p></c></row> <row><c><p>tga</p></c><c><p>TrueVision Targa (PC / DOS)</p></c></row> <row><c><p>tiff</p></c><c><p>Tag Image File Format</p></c></row> <row><c><p>wbf</p></c><c><p>WAP Bitmap File</p></c></row> <row><c><p>xbm</p></c><c><p>XWindows Bitmap File</p></c></row> <row><c><p>xpm</p></c><c><p>XWindows Pixmap File</p></c></row>
9b03652001-03-07Kenneth Johansson </xtable> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### format='png'/> </ex>
9b03652001-03-07Kenneth Johansson <ex type='vert'>
d246d82000-06-01Martin Nilsson <### format='gif'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='quant' value='number' default='format dependant'><p> The number of colors to quantizize the image to.</p>
d246d82000-06-01Martin Nilsson <p> Default for gif is 32(+1 transparent), for most other formats (except black and white) is it unlimited.</p>
9b03652001-03-07Kenneth Johansson <ex type='vert'>
d246d82000-06-01Martin Nilsson <### quant='2'/> </ex> </attr> <h3>Color/alpha attributes</h3>
9b03652001-03-07Kenneth Johansson <attr name='dither' value='none|random|floyd-steinberg' default='none'><p> Choose the dithering method.</p> <xtable>
d8c3322001-04-09Kenneth Johansson <row><h>Method</h><h>Meaning</h></row> <row><c><p>none</p></c><c><p>No dithering is performed at all.</p></c></row> <row><c><p>random</p></c><c><p>Random scatter dither. Not visually pleasing, but it is useful for very high resolution printing.</p></c></row> <row><c><p>floyd-steinberg</p></c><c><p>Error diffusion dithering. Usually the best dithering method.</p></c></row>
9b03652001-03-07Kenneth Johansson </xtable>
d246d82000-06-01Martin Nilsson 
9b03652001-03-07Kenneth Johansson <ex type='vert'>
d246d82000-06-01Martin Nilsson <### dither='random' quant='10'/> </ex>
9b03652001-03-07Kenneth Johansson <ex type='vert'>
d246d82000-06-01Martin Nilsson <### dither='floyd-steinberg' quant='10'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='true-alpha'><p>
d246d82000-06-01Martin Nilsson  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
9b03652001-03-07Kenneth Johansson  dithered using a floyd-steinberg dither.</p>
d246d82000-06-01Martin Nilsson 
9b03652001-03-07Kenneth Johansson <ex type='vert'>
d246d82000-06-01Martin Nilsson <### opaque-value='20'/> </ex>
9b03652001-03-07Kenneth Johansson <ex type='vert'>
d246d82000-06-01Martin Nilsson <### opaque-value='20' true-alpha='1'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='background-color' value='color' default='taken from the page'><p> The color to render the image against.</p> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### background-color='red' opaque-value='50'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='opaque-value' value='percentage' default='100'><p>
d246d82000-06-01Martin Nilsson  The transparency value to use, 100 is fully opaque, and 0 is fully
9b03652001-03-07Kenneth Johansson  transparent.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='cs-rgb-hsv' value='0|1' default='0'><p> Perform rgb to hsv colorspace conversion.</p> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### cs-rgb-hsv='1'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='gamma' value='number' default='1.0'><p> Perform gamma adjustment.</p> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### gamma='0.5'/> </ex>
9b03652001-03-07Kenneth Johansson <ex type='vert'>
d246d82000-06-01Martin Nilsson <### gamma='1.5'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='cs-grey' value='0|1' default='0'><p> Perform rgb to greyscale colorspace conversion.</p> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### cs-grey='1'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='cs-invert' value='0|1' default='0'><p> Invert all colors</p> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### cs-invert='1'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='cs-hsv-rgb' value='0|1' default='0'><p> Perform hsv to rgb colorspace conversion.</p> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### cs-hsv-rgb='1'/> </ex> </attr> <h3>Transform attributes</h3>
9b03652001-03-07Kenneth Johansson <attr name='rotate-cw' value='degree' default='0'><p> Rotate the image clock-wise.</p> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### rotate-cw='20'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='rotate-ccw' value='degree' default='0'><p> Rotate the image counter clock-wise.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='rotate-unit' value='rad|deg|ndeg|part' default='deg'><p> Select the unit to use while rotating.</p>
d246d82000-06-01Martin Nilsson 
9b03652001-03-07Kenneth Johansson <xtable>
d8c3322001-04-09Kenneth Johansson <row><h>Unit</h><h>Meaning</h></row> <row><c><p>rad</p></c><c><p>Radians</p></c></row> <row><c><p>deg</p></c><c><p>Degrees</p></c></row> <row><c><p>ndeg</p></c><c><p>'New' degrees (400 for each full rotation)</p></c></row> <row><c><p>part</p></c><c><p>0 - 1.0 (1.0 == full rotation)</p></c></row>
9b03652001-03-07Kenneth Johansson </xtable>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='mirror-x' value='0|1' default='0'><p> Mirror the image around the X-axis.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='mirror-y' value='0|1' default='0'><p> Mirror the image around the Y-axis.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='scale' value='fact' default='1.0'><p> Scale fact times. (0.5 -> half size, 2.0 -> double size)</p>
d246d82000-06-01Martin Nilsson <ex> <### scale='0.5'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='scale' value='x,y'><p>
d246d82000-06-01Martin Nilsson  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
9b03652001-03-07Kenneth Johansson  is scaled in proportion to the other value.</p>
d246d82000-06-01Martin Nilsson <ex> <### scale='20,50'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='max-width' value='xsize'><p>
d246d82000-06-01Martin Nilsson  If width is larger than 'xsize', scale width to 'xsize' while
9b03652001-03-07Kenneth Johansson  keeping aspect.</p> </attr> <attr name='max-height' value='ysize'><p> If height is larger than 'ysize', scale height to 'ysize' while keeping aspect.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='span-width' value='xsize'><p> 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.</p> <ex> <### span-width="350" background-color='white'/> </ex>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='span-height' value='ysize'><p> 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.</p>
d246d82000-06-01Martin Nilsson <ex>
9b03652001-03-07Kenneth Johansson <### span-height="350" background-color='white'/> </ex> </attr> <attr name='x-offset' value='pixels' default='0'><p> Cut n pixels from the beginning of the X scale.</p> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### x-offset='100'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='y-offset' value='pixels' default='0'><p> Cut n pixels from the beginning of the Y scale.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='x-size' value='pixels' default='whole image'><p> Keep n pixels from the beginning of the X scale.</p>
d246d82000-06-01Martin Nilsson <ex> <### x-size='100'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='y-size' value='pixels' default='whole image'><p> Keep n pixels from the beginning of the Y scale.</p>
d246d82000-06-01Martin Nilsson </attr>
c207ee2001-09-21Johan Sundström <attr name='crop' value='x1,y1-x2,y2|auto|guides-cross|guides-region'><p>
261aea2001-09-10Martin Nilsson  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.</p> <p>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.</p> <p>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.</p>
9b03652001-03-07Kenneth Johansson <ex type='vert'>
d246d82000-06-01Martin Nilsson <### crop='50,28-150,92'/> </ex>
261aea2001-09-10Martin Nilsson 
d246d82000-06-01Martin Nilsson </attr> <h3>Format specific attributes</h3>
9b03652001-03-07Kenneth Johansson <attr name='jpeg-quality' value='percentage' default='75'><p> Set the quality on the output jpeg image.</p> <ex type='vert'>
d246d82000-06-01Martin Nilsson <### format='jpeg' jpeg-quality='30'/> </ex>
9b03652001-03-07Kenneth Johansson <ex type='vert'>
d246d82000-06-01Martin Nilsson <### format='jpeg' jpeg-quality='1'/> </ex> </attr>
9b03652001-03-07Kenneth Johansson <attr name='jpeg-optimize' value='0|1' default='1'><p>
d246d82000-06-01Martin Nilsson  If 0, do not generate optimal tables. Somewhat faster, but produces
9b03652001-03-07Kenneth Johansson  bigger files.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='jpeg-progressive=' value='0|1' default='0'><p> Generate progressive jpeg images.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='jpeg-smooth' value='0-100' default='0'><p>
d246d82000-06-01Martin Nilsson  Smooth the image while compressing it. This produces smaller files,
9b03652001-03-07Kenneth Johansson  but might undo the effects of dithering.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='bmp-bpp' value='1,4,8,24' default='24'><p> Force this number of bits per pixel for bmp images.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='bmp-windows' value='0|1' default='1'><p> Windows or OS/2 mode, default is 1. (windows mode)</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='bmp-rle' value='0|1' default='0'><p> RLE 'compress' the BMP image.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='gd-alpha_index' value='color' default='0'><p>
d246d82000-06-01Martin Nilsson  Color in the colormap to make transparent for GD-images with alpha
9b03652001-03-07Kenneth Johansson  channel.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='pcx-raw' value='1|0' default='0'><p> If 1, do not RLE encode the PCX image.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='pcx-dpy' value='0-10000000.0' default='75.0'><p> Resolution, in pixels per inch.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='pcx-xdpy' value='0-10000000.0' default='75.0'><p> Resolution, in pixels per inch.</p>
d246d82000-06-01Martin Nilsson </attr>
261aea2001-09-10Martin Nilsson <attr name='pcx-ydpy' value='0-10000000.0' default='75.0'><p>
9b03652001-03-07Kenneth Johansson  Resolution, in pixels per inch.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='pcx-xoffset' value='0-imagexsize-2' default='0'><p>
d246d82000-06-01Martin Nilsson  Offset from start of image data to image content for PCX images.
9b03652001-03-07Kenneth Johansson  Unused by most programs.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='pcx-yoffset' value='0-imageysize-2' default='0'><p>
d246d82000-06-01Martin Nilsson  Offset from start of image data to image content for PCX images.
9b03652001-03-07Kenneth Johansson  Unused by most programs.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='tga-raw' value='1|0' default='0'><p> If 1, do not RLE encode the Targa image.</p>
d246d82000-06-01Martin Nilsson </attr>
9b03652001-03-07Kenneth Johansson <attr name='ps-dpi' value='0-10000000.0' default='75.0'><p> Dots per inch for the resulting postscript file.</p>
612ed22000-08-29Kenneth Johansson </attr>