module Mgk:sig..end
Interface for image-magick commands
main functions
type t
holds the command in progress
val new_genesis : unit -> tinitialise the command for a set of operations
val input_image : string -> t -> unitfilename of an image to load
val set_size : wh:int * int -> t -> unitset dimensions of an image, a canvas, or a layer
val init_canvas : string -> t -> unityou can initialise a transparent image with: "canvas:none"
val set_filename : string -> t -> unitset the filename of the image containing the result
val write_command : t -> unitoutput the resulting command on stdout to produce the requested operations
val display : t -> unitpipes the output to the display command
val new_genesis7 : unit -> tequivalent of new_genesis, but for IM-7 (not-tested)
draw commands
val draw_line : int * int -> int * int -> t -> unitdraw operation with a line command
val draw_point : int * int -> t -> unitdraw operation with a point command
val draw_rectangle : int * int -> int * int -> t -> unitdraw operation with a rectangle command
val draw_circle : int * int -> int -> t -> unitdraw operation with a circle command
val draw_ellipse : int * int -> int * int -> t -> unitdraw operation with a ellipse command
val draw_qbcurve : int * int -> int * int -> int * int -> t -> unitdraw operation with a quadratic bezier curve command
val draw_cbcurve : int * int -> int * int -> int * int -> int * int -> t -> unitdraw operation with a cubic bezier curve command
val draw_polygon : (int * int) list -> t -> unitdraw operation with a rectangle command
val draw_text : int * int -> string -> t -> unitdraw operation with a text command
val set_font : string -> t -> unitset the font for the draw-text operation
val set_pointsize : int -> t -> unitset the size of the text in points
val set_strokewidth : float -> t -> unitset the stroke-width for the draw operations
val set_fill : string -> t -> unitset the fill color for the draw operations
val set_stroke : string -> t -> unitset the stroke color for the draw operations
type path =
| |
M of |
(* | move-to | *) |
| |
L of |
(* | line-to | *) |
| |
Q of |
(* | quatratic-curve | *) |
| |
C of |
(* | cubic-curve | *) |
| |
A of |
(* | arcs | *) |
| |
Z |
(* | close path | *) |
svg commands
val draw_path : path list -> t -> unitdraw path with svg commands
combine different layers
typecomp_op =string
composite operator
val over : comp_opdefault operator, overlays the source image over the destination image
val multiply : comp_opmultiplies the source image with the destination image
val screen : comp_opmultiplies the inverse of the images and then inverses the result
val overlay : comp_opcombines Multiply and Screen
val darken : comp_optakes the darker pixel value
val lighten : comp_optakes the lighter pixel value
val add : comp_opadds pixel values
val subtract : comp_opsubtracts pixel values
most common composite operators
val plus : comp_op
val xor : comp_op
val atop : comp_op
val out : comp_op
val src : comp_op
val src_in : comp_op
val src_out : comp_op
val src_over : comp_op
val src_atop : comp_op
val dst_in : comp_op
val dst_out : comp_op
val dst_over : comp_op
val dst_atop : comp_op
val divide_src : comp_op
val divide_dst : comp_op
val minus_src : comp_op
val minus_dst : comp_op
val dissolve : comp_op
val difference : comp_op
val color_burn : comp_op
val color_dodge : comp_op
val linear_burn : comp_op
val linear_dodge : comp_op
val hard_light : comp_op
val soft_light : comp_op
val copy_opacity : comp_op
val seamless_blend : comp_opmore composite operators
val compositeop_of_string : string -> comp_opget a composite operator parameter from a string
(read the image-magick documentation for a list of composite-operators)
val set_composite_op : comp_op -> t -> unitselect a composite operator
val composite : t -> unitcomposite operation
val open_layer : (t -> unit) -> t -> unitopen a new layer
val set_geometry : int * int -> t -> unitsets the position for the composition of a layer
val base_layer : (t -> unit) -> t -> unitno-op, just for esthetic use
val list_compose : t -> unitlist all composite operators
val negate : t -> unit
val blur : int -> t -> unit
val normalize : t -> unit
val charcoal : int -> t -> unit
val grayscale : t -> unit
val sharpen : int -> t -> unit
val shade : int * int -> t -> unit
val modulate : int * int * int -> t -> unitmodulate, with brightness, saturation, and hue parameters
val resize : string -> t -> unitto resize half the size, use resize "50%" mgk
val flip : t -> unit
val flop : t -> unit
val posterize : int -> t -> unitposterize command
val paint : int -> t -> unitsimulate painting
val monochrome : t -> unitbinary colors
val emboss : int -> t -> unitemboss the image
val edge : int -> t -> unitedge filter
val auto_level : t -> unitadjust color levels
val convolve_sobel : t -> unitsobel convolution
typedither_method =string
type for dither-methods
val dither_riemersma : dither_methoddither-method: "Riemersma"
val dither : dither_method -> t -> unitdither operation
val colors : int -> t -> unitnumber of colors
val clone_last : t -> unit
val clone : int -> t -> unit
val clone_range : int * int -> t -> unit