STAY IN TOUCH

and receive our newsletter to get the latest news and tips.


Picture

A picture
function (Picture) → at(index : Number) returns Color
Gets the pixel color at the given linear index
function (Picture) → blend(other : Picture, left : Number, top : Number, angle : Number, opacity : Number)
Writes another picture at a given location. The opacity ranges from 0 (transparent) to 1 (opaque).
function (Picture) → blend svg(markup : String, left : Number, top : Number, width : Number, height : Number, angle : Number)
Writes an Scalable Vector Graphics (SVG) document at a given location. By default, this action uses the viewport size provided in the SVG document when width or height are negative.
function (Picture) → brightness(factor : Number)
Changes the brightness of the picture. factor in [-1, 1].
function (Picture) → clear(color : Color)
Clears the picture to a given color
function (Picture) → clear rect(color : Color, left : Number, top : Number, width : Number, height : Number)
Clears a rectangle on a the picture to a given color
function (Picture) → clone returns Picture
Returns a copy of the image
function (Picture) → colorize(background : Color, foreground : Color, threshold : Number)
Recolors the picture with the background and foreground color, based on a color threshold between 0.0 and 1.0
function (Picture) → contrast(factor : Number)
Changes the contrast of the picture. factor in [-1, 1].
function (Picture) → count returns Number
Gets the number of pixels
function (Picture) → crop(left : Number, top : Number, width : Number, height : Number)
Crops a sub-image
function (Picture) → date returns DateTime
Gets the date time where the picture was taken; if any.
function (Picture) → desaturate
Makes picture monochromatic (black and white)
function (Picture) → docs render(height : Number, caption : String)
Shows an art picture in the docs.
function (Picture) → draw ellipse(left : Number, top : Number, width : Number, height : Number, angle : Number, c : Color, thickness : Number)
Draws an elliptic border with a given color
function (Picture) → draw line(x1 : Number, y1 : Number, x2 : Number, y2 : Number, color : Color, thickness : Number)
Draws a line between two points
function (Picture) → draw path(left : Number, top : Number, angle : Number, color : Color, thickness : Number, data : String)
Draws a path with a given color.
function (Picture) → draw rect(left : Number, top : Number, width : Number, height : Number, angle : Number, color : Color, thickness : Number)
Draws a rectangle border with a given color
function (Picture) → draw text(left : Number, top : Number, text : String, font size : Number, angle : Number, color : Color)
Draws some text border with a given color and font size
function (Picture) → equals(other picture : Picture) returns Boolean
Checks if the picture is the same instance as the other picture. This action does not check that pixels are the same between two different pictures.
function (Picture) → fill ellipse(left : Number, top : Number, width : Number, height : Number, angle : Number, color : Color)
Fills a ellipse with a given color
function (Picture) → fill path(left : Number, top : Number, angle : Number, color : Color, data : String)
Fills a path with a given color.
function (Picture) → fill rect(left : Number, top : Number, width : Number, height : Number, angle : Number, color : Color)
Fills a rectangle with a given color
function (Picture) → flip horizontal
Flips the picture horizontally
function (Picture) → flip vertical
Flips the picture vertically
function (Picture) → height returns Number
Gets the height in pixels
function (Picture) → invert
Inverts the red, blue and green channels
function (Picture) → is invalid returns Boolean
Returns true if the current instance is useless
function (Picture) → is panorama returns Boolean
Indicates if the picture width is greater than its height
function (Picture) → location returns Location
Gets the location where the picture was taken; if any.
function (Picture) → negative
Inverts the colors in the picture
function (Picture) → pixel(left : Number, top : Number) returns Color
Gets the pixel color
function (Picture) → post to wall
Displays the image to the wall; you need to call 'update on wall' later if you want changes to be reflected.
function (Picture) → readonly url returns String
Get the web address of an art resource; invalid if not available.
function (Picture) → resize(width : Number, height : Number)
Resizes the picture to the given size in pixels
function (Picture) → save to library returns String
Saves the picture and returns the file name if successful.
function (Picture) → set pixel(left : Number, top : Number, color : Color)
Sets the pixel color at a given pixel
function (Picture) → share(where : String, message : String)
Shares this message ('' to pick from a list)
function (Picture) → tint(color : Color)
Converts every pixel to gray and tints it with the given color.
function (Picture) → to buffer returns Buffer
Copy all pixels from the picture
function (Picture) → to data uri(quality : Number) returns String
Encodes the image into a data uri using the desired quality (1 best, 0 worst). If the quality value is 1, the image is encoded as PNG, otherwise JPEG.
function (Picture) → update on wall
Refreshes the picture on the wall
function (Picture) → width returns Number
Gets the width in pixels
function (Picture) → write buffer(buffer : Buffer)
Copy pixels from buffer to the picture

edit this topic vthplbdjzl