This module provides functions to handle image manipulations like resizing, zooming, special effects etc.
The errors raised by functions of this module have the namespace http://zorba.io/modules/image/error (associated with prefix ierr).
add-noise
($image as xs:base64Binary, $noise-type as xs:string) as xs:base64Binary
Add noise to an image. |
blur
($image as xs:base64Binary, $radius as xs:int, $sigma as xs:int) as xs:base64Binary external
Blur an image. |
charcoal
($image as xs:base64Binary, $radius as xs:double, $sigma as xs:double) as xs:base64Binary external
Apply a charcoal effect to the image (looks like a charcoal sketch). |
chop
($image as xs:base64Binary, $upper-left-x as xs:unsignedInt, $upper-left-y as xs:unsignedInt) as xs:base64Binary external
Copy a part of a source image as new image. |
contrast
($image as xs:base64Binary, $sharpen as xs:double) as xs:base64Binary external
Contrast an image (enhances image intensity differences) by a given value. |
crop
($image as xs:base64Binary, $lower-right-x as xs:unsignedInt, $lower-right-y as xs:unsignedInt) as xs:base64Binary external
Copy a part of a source image as new image. |
despeckle
($image as xs:base64Binary) as xs:base64Binary external
Despeckle an image. |
edge
($image as xs:base64Binary, $radius as xs:unsignedInt) as xs:base64Binary external
Highlight edges in an image. |
emboss
($image as xs:base64Binary, $radius as xs:double, $sigma as xs:double) as xs:base64Binary external
Emboss an images (highlights edges with 3D effect). |
enhance
($image as xs:base64Binary) as xs:base64Binary external
Enhance an images (minimizes noise). |
equalize
($image as xs:base64Binary) as xs:base64Binary external
Equalize an images (histogramm equalization). |
erase
($image as xs:base64Binary) as xs:base64Binary external
Set all pixels of the image to the current backround color. |
flip
($image as xs:base64Binary) as xs:base64Binary external
Flip an image (vertical rotation). |
flop
($image as xs:base64Binary) as xs:base64Binary external
Flop an image (horizontal rotation). |
gamma
($image as xs:base64Binary, $gamma-value as xs:double) as xs:base64Binary external
Gamma correct an image. |
gamma
($image as xs:base64Binary, $gamma-red as xs:double, $gamma-green as xs:double, $gamma-blue as xs:double) as xs:base64Binary external
Gamma correct an image for every color channel seperately. |
implode
($image as xs:base64Binary, $factor as xs:double) as xs:base64Binary external
Apply an implode effect to an image (a sort of special effect). |
oil-paint
($image as xs:base64Binary, $radius as xs:double) as xs:base64Binary external
Apply an oil paint effect to an image (makes the image look as if it was an oil paint). |
overlay
($image as xs:base64Binary, $overlay-image as xs:base64Binary, $overlay-upper-left-x as xs:unsignedInt, $overlay-upper-left-y as xs:unsignedInt, $operator as xs:string) as xs:base64Binary
Overlay $image with $overlay-image at the specfied position. |
reduce-noise
($image as xs:base64Binary, $order as xs:double) as xs:base64Binary external
Reduce noise of an image using a noise peak elemination filter. |
resize
($image as xs:base64Binary, $width as xs:unsignedInt, $height as xs:unsignedInt) as xs:base64Binary external
Get a copy of the passed image with changed width and height (without zooming the image's content). |
rotate
($image as xs:base64Binary, $angle as xs:int) as xs:base64Binary external
Get a new image as rotated copy of a passed source image (rotated by -360 to 360 degrees). |
solarize
($image as xs:base64Binary, $factor as xs:double) as xs:base64Binary external
Apply a solarize effect to the image (similar to the effect seen when exposing a photographic film to light during the development process). |
stereo
($left-image as xs:base64Binary, $right-image as xs:base64Binary) as xs:base64Binary external
Make two passed images appear as stereo image when viewed with red-blue glasses. |
sub-image
($image as xs:base64Binary, $left-upper-x as xs:unsignedInt, $left-upper-y as xs:unsignedInt, $width as xs:unsignedInt, $height as xs:unsignedInt) as xs:base64Binary external
Copy a part of the source image specified by a rectangle. |
swirl
($image as xs:base64Binary, $degree as xs:double) as xs:base64Binary external
Swirl an image (image pixels are rotated by degree). |
transparent
($image as xs:base64Binary, $color as xs:string) as xs:base64Binary
Make all pixels of the specfied color transparent. |
trim
($image as xs:base64Binary) as xs:base64Binary external
Trim edges of the image's background color from the image. |
watermark
($image as xs:base64Binary, $watermark as xs:base64Binary) as xs:base64Binary external
Add a $watermark image to $image. |
zoom-by-height
($image as xs:base64Binary, $height as xs:unsignedInt) as xs:base64Binary external
Zoom the passed image to a given new height while keeping the ratio between width and height. |
zoom-by-width
($image as xs:base64Binary, $width as xs:unsignedInt) as xs:base64Binary external
Zoom the passed image to a given new width while keeping the ratio between width and height. |
zoom
($image as xs:base64Binary, $ratio as xs:double) as xs:base64Binary external
Zoom the passed image by the specified factor while keeping the ratio between width and height. |
declare function man:add-noise($image as xs:base64Binary, $noise-type as xs:string) as xs:base64Binary
Add noise to an image.
Allowed noise types are:
declare function man:blur($image as xs:base64Binary, $radius as xs:int, $sigma as xs:int) as xs:base64Binary external
Blur an image.
declare function man:charcoal($image as xs:base64Binary, $radius as xs:double, $sigma as xs:double) as xs:base64Binary external
Apply a charcoal effect to the image (looks like a charcoal sketch).
declare function man:chop($image as xs:base64Binary, $upper-left-x as xs:unsignedInt, $upper-left-y as xs:unsignedInt) as xs:base64Binary external
Copy a part of a source image as new image.
The copied part is all right of $upper-left-x and below $upper-left-y.
declare function man:contrast($image as xs:base64Binary, $sharpen as xs:double) as xs:base64Binary external
Contrast an image (enhances image intensity differences) by a given value.
declare function man:crop($image as xs:base64Binary, $lower-right-x as xs:unsignedInt, $lower-right-y as xs:unsignedInt) as xs:base64Binary external
Copy a part of a source image as new image.
The copied part is all left of $lower-right-x and above $lower-right-y.
declare function man:despeckle($image as xs:base64Binary) as xs:base64Binary external
Despeckle an image.
declare function man:edge($image as xs:base64Binary, $radius as xs:unsignedInt) as xs:base64Binary external
Highlight edges in an image.
declare function man:emboss($image as xs:base64Binary, $radius as xs:double, $sigma as xs:double) as xs:base64Binary external
Emboss an images (highlights edges with 3D effect).
declare function man:enhance($image as xs:base64Binary) as xs:base64Binary external
Enhance an images (minimizes noise).
declare function man:equalize($image as xs:base64Binary) as xs:base64Binary external
Equalize an images (histogramm equalization).
declare function man:erase($image as xs:base64Binary) as xs:base64Binary external
Set all pixels of the image to the current backround color.
In most cases, this will result in all pixels to be set to white.
declare function man:flip($image as xs:base64Binary) as xs:base64Binary external
Flip an image (vertical rotation).
declare function man:flop($image as xs:base64Binary) as xs:base64Binary external
Flop an image (horizontal rotation).
declare function man:gamma($image as xs:base64Binary, $gamma-value as xs:double) as xs:base64Binary external
Gamma correct an image.
Gamma values less than zero will erase the image.
declare function man:gamma($image as xs:base64Binary, $gamma-red as xs:double, $gamma-green as xs:double, $gamma-blue as xs:double) as xs:base64Binary external
Gamma correct an image for every color channel seperately.
Gamma values less than zero for any color will erase the corresponding color.
declare function man:implode($image as xs:base64Binary, $factor as xs:double) as xs:base64Binary external
Apply an implode effect to an image (a sort of special effect).
declare function man:oil-paint($image as xs:base64Binary, $radius as xs:double) as xs:base64Binary external
Apply an oil paint effect to an image (makes the image look as if it was an oil paint).
declare function man:overlay($image as xs:base64Binary, $overlay-image as xs:base64Binary, $overlay-upper-left-x as xs:unsignedInt, $overlay-upper-left-y as xs:unsignedInt, $operator as xs:string) as xs:base64Binary
Overlay $image with $overlay-image at the specfied position.
The $operator defines the details of the overlay and can have one of the following values:
declare function man:reduce-noise($image as xs:base64Binary, $order as xs:double) as xs:base64Binary external
Reduce noise of an image using a noise peak elemination filter.
declare function man:resize($image as xs:base64Binary, $width as xs:unsignedInt, $height as xs:unsignedInt) as xs:base64Binary external
Get a copy of the passed image with changed width and height (without zooming the image's content).
To change the size of the actual contents of an image, use the zoom function.
More in detail: If the new dimensions are greater than the current dimensions the new image will have the passed image in the upper left corner and the rest will be filled with the current background color.
If the passed dimensions are less than the current dimensions, the new image will contain the specified rectangle of the passed image beginning at the upper left corner.
declare function man:rotate($image as xs:base64Binary, $angle as xs:int) as xs:base64Binary external
Get a new image as rotated copy of a passed source image (rotated by -360 to 360 degrees).
The image is enlarged if this is required for containing the rotated image, but never shrunk even if the rotation would make a smaller image possible.
declare function man:solarize($image as xs:base64Binary, $factor as xs:double) as xs:base64Binary external
Apply a solarize effect to the image (similar to the effect seen when exposing a photographic film to light during the development process).
declare function man:stereo($left-image as xs:base64Binary, $right-image as xs:base64Binary) as xs:base64Binary external
Make two passed images appear as stereo image when viewed with red-blue glasses.
Both images should be same but from a slightly different angle for this to work.
Both images should have the same size, if not, the size of the left image will be taken.
declare function man:sub-image($image as xs:base64Binary, $left-upper-x as xs:unsignedInt, $left-upper-y as xs:unsignedInt, $width as xs:unsignedInt, $height as xs:unsignedInt) as xs:base64Binary external
Copy a part of the source image specified by a rectangle.
If the passed parameters for the sub-image specify a rectangle that isn't entirely within the source image only the area that lies within the image boundaries will be returned.
declare function man:swirl($image as xs:base64Binary, $degree as xs:double) as xs:base64Binary external
Swirl an image (image pixels are rotated by degree).
declare function man:transparent($image as xs:base64Binary, $color as xs:string) as xs:base64Binary
Make all pixels of the specfied color transparent.
This works correctly only with image types supporting transparency (e.g GIF or PNG).
declare function man:trim($image as xs:base64Binary) as xs:base64Binary external
Trim edges of the image's background color from the image.
declare function man:watermark($image as xs:base64Binary, $watermark as xs:base64Binary) as xs:base64Binary external
Add a $watermark image to $image.
declare function man:zoom-by-height($image as xs:base64Binary, $height as xs:unsignedInt) as xs:base64Binary external
Zoom the passed image to a given new height while keeping the ratio between width and height.
So, the width is scaled accordingly.
Important note: this function does not change the size information stored in the image (e.g. basic:width will not show a different value).
declare function man:zoom-by-width($image as xs:base64Binary, $width as xs:unsignedInt) as xs:base64Binary external
Zoom the passed image to a given new width while keeping the ratio between width and height.
So, the height is scaled accordingly.
Important note: this function does not change the size information stored in the image (e.g. basic:width will not show a different value).
declare function man:zoom($image as xs:base64Binary, $ratio as xs:double) as xs:base64Binary external
Zoom the passed image by the specified factor while keeping the ratio between width and height.
A ratio of less than 1 will make the image smaller.
A ratio of less or equal than 0 will not effect the image.
Important note: this function does not change the size information stored in the image (e.g. basic:width will not show a different value).