This extension contains functions for manipulating images.  Related Links: Extension Overview, DekiScript Overview, Extension Demos.

Assembly: mindtouch.deki.services
SID: http://services.mindtouch.com/deki/draft/2007/06/imagemagick
License: none

This service requires Deki Wiki 1.8.2 or later.

To enable this extension, follow these steps:

  1. Go to Service management in the Control Panel of your wiki.
  2. Under Add Service, click on Local, and select type Extension.
  3. Enter a description and the extension SID: http://services.mindtouch.com/deki/draft/2007/06/imagemagick
  4. Add any additional configuration settings that are required by the extension (see below).
  5. Click on add service.

Configuration:

Before the ImageMagick service can be used, it must be configured with the location of the ImageMagick application.  Download the latest version here.

Config Key Description
imagemagick-path Path to convert application.

Functions:

IMPORTANT:  Function availability depends on the installed version of ImageMagick.

  1. image.blend
  2. image.blur
  3. image.charcoal
  4. image.emboss
  5. image.fittosize
  6. image.flip
  7. image.flop
  8. image.outline
  9. image.paint
  10. image.polaroid
  11. image.raise
  12. image.resize
  13. image.rotate
  14. image.sink
  15. image.slideshow
  16. image.swirl
  17. image.vignette
  18. image.wave

image.blend(image : uri) : uri

Generate image with a soft rectangular border.

Parameters:

Name Type Description
image
uri
Image uri

Samples:


Output

To embed an image with the blend effect:

 {{ image.blend("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageBlend1.JPG

To embed an imaged with both blend and resize effects:

{{ image.resize( image.blend("http://wiki.opengarden.org/@api/deki/files/1154"), 50, 100) }}

./ImageBlend2.JPG


image.blur(image : uri, radius : num, sigma : num) : uri

Blur image.

Parameters:

Name Type Description
image
uri
Image uri
radius
num
Optional.  Radius (default: 0)
sigma
num
Optional.  Sigma (default: 1)

Samples:


Output

To embed an image with the default blur effect:

 {{ image.blur("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageBlur1.JPG


image.charcoal(image : uri, kernel : num) : uri

Simulate image painted with charcoal.

Parameters:

Name Type Description
image
uri
Image uri
kernel
num
Optional.  Kernel size, must be an odd number (default: 3)

Samples:


Output

To embed an image with the default charcoal effect:

{{ image.charcoal("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageCharcoal1.JPG

To embed an image with a kernel size 5 charcoal effect:

{{ image.charcoal("http://wiki.opengarden.org/@api/deki/files/1154", 5) }}

./ImageCharcoal2.JPG


image.emboss(image : uri, radius : num) : uri

Generate embossed image.

Parameters:

Name Type Description
image
uri
Image uri
radius
num
Optional.  Radius (default: 1)

Samples:


Output

To embed an image with the default emboss effect:

{{ image.emboss("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageEmboss1.JPG

To embed an image with a radius size 5 charcoal effect:

{{ image.emboss("http://wiki.opengarden.org/@api/deki/files/1154", 5) }}

./ImageEmboss2.JPG


image.fittosize(image : uri, width : num, height : num) : uri

Fit image to dimensions and preserve its aspect ratio

Parameters:

Name Type Description
image
uri
Image uri
width
num
Optional.  Width (max: 500)
height
num
Optional.  Height (max: 500)

Samples:


Output

To embed an image that is fit a size of 50 by 50:

{{ image.fittosize("http://wiki.opengarden.org/@api/deki/files/1154", 50, 50) }}

./ImageFitToSize1.JPG

To embed an image that is flipped verically and then fit to a size of 50 by 50:

{{ image.fittosize( image.flip("http://wiki.opengarden.org/@api/deki/files/1154"), 50, 50) }}

./ImageFitToSize2.JPG


image.flip(image : uri) : uri

Flip image vertically.

Parameters:

Name Type Description
image
uri
Image uri

Samples:


Output

To embed an image that is flipped verically:

{{ image.flip("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageFlip1.JPG


image.flop(image : uri) : uri

Flip image horizontally.

Parameters:

Name Type Description
image
uri
Image uri

Samples:


Output

To embed an image that is flipped horizontally:

{{ image.flop("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageFlop1.JPG

To embed an image that is flipped vertically then horizonally:

{{ image.flop(image.flip("http://wiki.opengarden.org/@api/deki/files/1154")) }}

./ImageFlop2.JPG


image.outline(image : uri) : uri

Generate outline of image.

Parameters:

Name Type Description
image
uri
Image uri

Samples:


Output

To embed an image with the outline effect:

{{ image.outline("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageOutline1.JPG


image.paint(image : uri, radius : num) : uri

Simulate image painted with color blobs.

Parameters:

Name Type Description
image
uri
Image uri
radius
num
Optional.  Radius (default: 1)

Samples:


Output

To embed an image with the paint effect:

{{ image.paint("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImagePaint1.JPG


image.polaroid(image : uri, angle : num, caption : str) : uri

Generate image with white border and optional sub-title.  This function is not supported on Debian.

Parameters:

Name Type Description
image
uri
Image uri
angle
num
Optional.  Rotation angle (default: 3)
caption
str
Optional.  Caption (default: nil)

Samples:


Output

To embed an image with the default polaroid effect:

{{ image.polaroid("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImagePolaroid1.JPG

To embed an image with a 15 degree rotation and MindTouch caption polaroid effect:

{{ image.polaroid("http://wiki.opengarden.org/@api/deki/files/1154", 15, "MindTouch") }}


./ImagePolaroid2.JPG

To embed an image with two 15 degree rotation and MindTouch caption polaroid effects:

{{ image.polaroid(image.polaroid("http://wiki.opengarden.org/@api/deki/files/1154", 15, "MindTouch"), 15, "MindTouch") }}


./ImagePolaroid3.JPG


image.raise(image : uri, width : num) : uri

Generate image with a raised border.

Parameters:

Name Type Description
image
uri
Image uri
width
num
Optional.  Border width (default: 8)

Samples:


Output

To embed an image with the default raise effect:

{{ image.raise("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageRaise1.JPG

To embed an image with a border width 3 raise effect:

{{ image.raise("http://wiki.opengarden.org/@api/deki/files/1154", 3) }}


./ImageRaise2.JPG


image.resize(image : uri, width : num, height : num) : uri

Resize image to arbitrary dimensions.

Parameters:

Name Type Description
image
uri
Image uri
width
num
Optional.  Width (max: 500)
height
num
Optional.  Height (max: 500)

Samples:


Output

To embed an image resized to 50 by 100:

{{ image.resize("http://wiki.opengarden.org/@api/deki/files/1154", 50, 100) }}

./ImageResize1.JPG


image.rotate(image : uri, angle : num) : uri

Rotate image.

Parameters:

Name Type Description
image
uri
Image uri.
angle
num
Optional.  Rotation angle.

Samples:


Output

To embed an image rotated by 15 degrees:

{{ image.rotate("http://wiki.opengarden.org/@api/deki/files/1154", 15) }}

./ImageRotate1.JPG

To embed an image rotated by 15 degrees and resized to 50 by 50:

{{ image.resize(image.rotate("http://wiki.opengarden.org/@api/deki/files/1154", 15), 50, 50) }}


./ImageRotate2.JPG


image.sink(image : uri, width : num) : uri

Generate image with a sunken border.

Parameters:

Name Type Description
image
uri
Image uri.
width
num
Optional.  Border width (default: 8)

Samples:


Output

To embed an image with the default sink effect:

{{ image.sink("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageSink1.JPG

To embed an image with a border width 3 sink effect:

{{ image.sink("http://wiki.opengarden.org/@api/deki/files/1154", 3) }}


./ImageSink2.JPG


image.slideshow(uris : list, width : num, height : num, interval : num, effect : str) : xml

Embed a slideshow of images.

Parameters:

Name Type Description
uris
list
List of image URIs
width
num
Optional.  Slideshow width (default: 300px)
height
num
Optional.  Slideshow height (default: 300px)
interval
num
Optional.  Interval in seconds (default: 5.0)
effect
str
Optional.  Slideshow effect; one of {slideright, slideleft, slideup, squeezeleft, squeezeright, squeezeup, squeezedown, fadeout} (default: 'fadeout')

Samples:


Output

To embed a slideshow that displays an image at four rotation angles:

{{ image.slideshow(
    [image.rotate("http://wiki.opengarden.org/@api/deki/files/1154", 0),
     image.rotate("http://wiki.opengarden.org/@api/deki/files/1154", 90),
     image.rotate("http://wiki.opengarden.org/@api/deki/files/1154", 180),
     image.rotate("http://wiki.opengarden.org/@api/deki/files/1154", 270) 
    ], 50, 50, 2) }}

./Slideshow.gif


image.swirl(image : uri, angle : num) : uri

Twist the image from the center outward.

Parameters:

Name Type Description
image
uri
Image uri.
angle
num
Optional.  Swirl angle (default: 45)

Samples:


Output

To embed an image with the default swirl effect:

{{ image.swirl("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageSwirl1.JPG

To embed an image with a 180 degree swirl effect:

{{ image.swirl("http://wiki.opengarden.org/@api/deki/files/1154", 180) }}


./ImageSwirl2.JPG


image.vignette(image : uri, radius : num, sigma : num) : uri

Generate image with a soft oval border.

Parameters:

Name Type Description
image
uri
Image uri.
radius
num
Optional.  Radius (default: 0)
sigma
num
Optional.  Sigma (default: 4)

Samples:


Output

To embed an image with the default vignette effect:

{{ image.vignette("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageVignette1.JPG


image.wave(image : uri, amplitude : num, length : num) : uri

Generate image with a wave.

Parameters:

Name Type Description
image
uri
Image uri.
amplitude
num
Optional.  Wave amplitude (default: 5)
length
num
Optional.  Wave length (default: 50)

Samples:


Output

To embed an image with the default wave effect:

{{ image.wave("http://wiki.opengarden.org/@api/deki/files/1154") }}

./ImageWave1.JPG

Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08.1a