Functions
draw
draw(id1, id2, filters, disableParallelization?)
Applies the filters to image1 with the output going into image2.
- id1
int<collection.IMAGE>
- id2
int<collection.IMAGE>
- filters
[]struct<filter.Filter>
- disableParallelization
bool
draw_at
draw_at(id1, id2, point, op, filters, disableParallelization?)
Applies the filters to image1 with the output going into image2.
- id1
int<collection.IMAGE>
- id2
int<collection.IMAGE>
- point
struct<image.Point>
- op
int<filter.Operator>
- filters
[]struct<filter.Filter>
- disableParallelization
bool
draw_at_xy
draw_at_xy(id1, id2, x, y, op, filters, disableParallelization?)
Applies the filters to image1 with the output going into image2.
- id1
int<collection.IMAGE>
- id2
int<collection.IMAGE>
- x
int
- y
int
- op
int<filter.Operator>
- filters
[]struct<filter.Filter>
- disableParallelization
bool
bounds
bounds(id, filters, disableParallelization?) -> int, int, int, int
@blocking
Gets the resulting bounds of the image after the filters are applied.
- id
int<collection.IMAGE>
- filters
[]struct<filter.Filter>
- disableParallelization
bool
int
- X position of the top left corner of the images bounds after the filters are applied.int
- Y position of the top left corner of the images bounds after the filters are applied.int
- X position of the bottom right corner of the images bounds after the filters are applied.int
- Y position of the bottom right corner of the images bounds after the filters are applied.
bounds_size
bounds_size(id, filters, disableParallelization?) -> int, int
@blocking
Gets the resulting size of the image after the filters are applied.
- id
int<collection.IMAGE>
- filters
[]struct<filter.Filter>
- disableParallelization
bool
int
- Width of the image after the filters are applied.int
- Height of the image after the filters are applied.
brightness
brightness(percent) -> struct<filter.FilterBrightness>
- percent
float
- Percent value between -100 and 100.
struct<filter.FilterBrightness>
color_balance
color_balance(percentRed, percentGreen, percentBlue) -> struct<filter.FilterColorBalance>
- percentRed
float
- Percent values between -100 and 500. - percentGreen
float
- Percent values between -100 and 500. - percentBlue
float
- Percent values between -100 and 500.
struct<filter.FilterColorBalance>
colorize
colorize(hue, saturation, percent) -> struct<filter.FilterColorize>
- hue
float
- Hue value between 0 and 360. - saturation
float
- Saturation value between 0 and 100. - percent
float
- Percent value between 0 and 100.
struct<filter.FilterColorize>
colorspace_linear_to_srgb
colorspace_linear_to_srgb() -> struct<filter.FilterColorspaceLinearToSRGB>
struct<filter.FilterColorspaceLinearToSRGB>
colorspace_srgb_to_linear
colorspace_srgb_to_linear() -> struct<filter.FilterColorspaceSRGBToLinear>
struct<filter.FilterColorspaceSRGBToLinear>
contrast
contrast(percent) -> struct<filter.FilterContrast>
- percent
float
- Percent values between -100 and 100.
struct<filter.FilterContrast>
convolution
convolution(kernel, normalize, alpha, abs, delta) -> struct<filter.FilterConvolution>
- kernel
[]float
- Must have a length of an odd square, e.g. 3x3=9 or 5x5=25. - normalize
bool
- alpha
bool
- abs
bool
- delta
float
struct<filter.FilterConvolution>
crop
crop(min, max) -> struct<filter.FilterCrop>
- min
struct<image.Point>
- Top left corner of new image. - max
struct<image.Point>
- Bottom right corner of new image.
struct<filter.FilterCrop>
crop_xy
crop_xy(xmin, ymin, xmax, ymax) -> struct<filter.FilterCrop>
- xmin
int
- X position of the top left corner. - ymin
int
- Y position of the top left corner. - xmax
int
- X position of the bottom right corner. - ymax
int
- Y position of the bottom right corner.
struct<filter.FilterCrop>
crop_to_size
crop_to_size(width, height, anchor) -> struct<filter.FilterCropToSize>
- width
int
- Width of the new image. - height
int
- Height of the new image. - anchor
int<filter.Anchor>
struct<filter.FilterCropToSize>
flip_horizontal
flip_horizontal() -> struct<filter.FilterFlipHorizontal>
struct<filter.FilterFlipHorizontal>
flip_vertical
flip_vertical() -> struct<filter.FilterFlipVertical>
struct<filter.FilterFlipVertical>
gamma
gamma(gamma) -> struct<filter.FilterGamma>
- gamma
float
- Must be positive, a value of 1 maintains the image.
struct<filter.FilterGamma>
gaussian_blur
gaussian_blur(sigma) -> struct<filter.FilterGaussianBlur>
- sigma
float
- Radius of blur is ~3*sigma.
struct<filter.FilterGaussianBlur>
grayscale
grayscale() -> struct<filter.FilterGreyscale>
struct<filter.FilterGreyscale>
invert
invert() -> struct<filter.FilterInvert>
struct<filter.FilterInvert>
rotate
rotate(angle, bgcolor, interpolation) -> struct<filter.FilterRotate>
When doing rotations on multiples of 90 degrees, it is best to use the rotate filters for 90, 180, and 270.
- angle
float
- Angle value in degrees. - bgcolor
struct<image.Color>
- interpolation
int<filter.Interpolation>
struct<filter.FilterRotate>
rotate_90
rotate_90() -> struct<filter.FilterRotate90>
struct<filter.FilterRotate90>
rotate_180
rotate_180() -> struct<filter.FilterRotate180>
struct<filter.FilterRotate180>
rotate_270
rotate_270() -> struct<filter.FilterRotate270>
struct<filter.FilterRotate270>
hue
hue(shift) -> struct<filter.FilterHue>
- shift
float
- Shift value between -180 and 180.
struct<filter.FilterHue>
saturation
saturation(percent) -> struct<filter.FilterSaturation>
- percent
float
- Percent value between -100 and 500.
struct<filter.FilterSaturation>
sepia
sepia(percent) -> struct<filter.FilterSepia>
- percent
float
- Percent value between 0 and 100.
struct<filter.FilterSepia>
pixelate
pixelate(size) -> struct<filter.FilterPixelate>
- size
int
struct<filter.FilterPixelate>
threshold
threshold(percent) -> struct<filter.FilterThreshold>
- percent
float
- Percent value between 0 and 100.
struct<filter.FilterThreshold>
transpose
transpose() -> struct<filter.FilterTranspose>
struct<filter.FilterTranspose>
transverse
transverse() -> struct<filter.FilterTransverse>
struct<filter.FilterTranverse>
sobel
sobel() -> struct<filter.FilterSobel>
struct<filter.FilterSobel>
maximum
maximum(ksize, disk) -> struct<filter.FilterMaximum>
- ksize
int
- Must be odd int, e.g. 3, 5, 7. - disk
bool
- If the kernel used should be disk shaped instead of a square.
struct<filter.FilterMaximum>
mean
mean(ksize, disk) -> struct<filter.FilterMean>
- ksize
int
- Must be odd int, e.g. 3, 5, 7. - disk
bool
- If the kernel used should be disk shaped instead of a square.
struct<filter.FilterMean>
median
median(ksize, disk) -> struct<filter.FilterMedian>
- ksize
int
- Must be odd int, e.g. 3, 5, 7. - disk
bool
- If the kernel used should be disk shaped instead of a square.
struct<filter.FilterMedian>
minimum
minimum(ksize, disk) -> struct<filter.FilterMinimum>
- ksize
int
- Must be odd int, e.g. 3, 5, 7. - disk
bool
- If the kernel used should be disk shaped instead of a square.
struct<filter.FilterMinimum>
sigmoid
sigmoid(midpoint, factor) -> struct<filter.FilterSigmoid>
Adjusts the contrast of the image, but on a curve instead of linearly.
- midpoint
float
- Value between 0 and 1. - factor
float
struct<filter.FilterSigmoid>
unsharp_mask
unsharp_mask(sigma, amount, threshold) -> struct<filter.FilterUnsharpMask>
- sigma
float
- Radius is ~3*sigma. - amount
float
- Typically between 0.5 and 1.5. - threshold
float
- Minimum brightness change to sharpen, typically between 0 and 0.05.
struct<filter.FilterUnsharpMask>
resize
resize(width, height, resampling) -> struct<filter.FilterResize>
- width
int
- height
int
- resampling
int<filter.Resampling>
struct<filter.FilterResize>
resize_to_fill
resize_to_fill(width, height, resampling, anchor) -> struct<filter.FilterResizeToFill>
- width
int
- height
int
- resampling
int<filter.Resampling>
- anchor
int<filter.Anchor>
struct<filter.FilterResizeToFill>
resize_to_fit
resize_to_fit(width, height, resampling) -> struct<filter.FilterResizeToFit>
- width
int
- height
int
- resampling
int<filter.Resampling>
struct<filter.FilterResizeToFit>
color_func
color_func(fn) -> struct<filter.FilterColorFunc>
Color values are floats between 0 and 1.
- fn
function(r float, g float, b float, a float) -> float, float, float, float
struct<filter.FilterColorFunc>
color_func_unsafe
color_func_unsafe(fn) -> struct<filter.FilterColorFuncUnsafe>
Color values are floats between 0 and 1. Note parallelization must be disabled when drawing for this to work. This has the benefit of not requiring new lua threads on each function call, but this means it is not thread safe.
- fn
function(r float, g float, b float, a float) -> float, float, float, float
struct<filter.FilterColorFuncUnsafe>
Constants
Anchor
ANCHOR_CENTER
ANCHOR_TOPLEFT
ANCHOR_TOP
ANCHOR_TOPRIGHT
ANCHOR_LEFT
ANCHOR_RIGHT
ANCHOR_BOTTOMLEFT
ANCHOR_BOTTOM
ANCHOR_BOTTOMRIGHT
Interpolation
INTERPOLATION_NEARESTNEIGHBOR
INTERPOLATION_LINEAR
INTERPOLATION_CUBIC
Operator
OPERATOR_COPY
OPERATOR_OVER
Resampling
RESAMPLING_BOX
RESAMPLING_CUBIC
RESAMPLING_LANCZOS
RESAMPLING_LINEAR
RESAMPLING_NEARESTNEIGHBOR
FilterType
FILTER_BRIGHTNESS
FILTER_COLOR_BALANCE
FILTER_COLORIZE
FILTER_COLORSPACE_LINEAR_TO_SRGB
FILTER_COLORSPACE_SRGB_TO_LINEAR
FILTER_CONTRAST
FILTER_CONVOLUTION
FILTER_CROP
FILTER_CROP_TO_SIZE
FILTER_FLIP_HORIZONTAL
FILTER_FLIP_VERTICAL
FILTER_GAMMA
FILTER_GAUSSIAN_BLUR
FILTER_GRAYSCALE
FILTER_INVERT
FILTER_ROTATE
FILTER_ROTATE90
FILTER_ROTATE180
FILTER_ROTATE270
FILTER_HUE
FILTER_SATURATION
FILTER_SEPIA
FILTER_THRESHOLD
FILTER_PIXELATE
FILTER_SOBEL
FILTER_TRANSPOSE
FILTER_TRANSVERSE
FILTER_MAXIMUM
FILTER_MEAN
FILTER_MEDIAN
FILTER_MINIMUM
FILTER_SIGMOID
FILTER_UNSHARP_MASK
FILTER_RESIZE
FILTER_RESIZE_TO_FILL
FILTER_RESIZE_TO_FIT
FILTER_COLOR_FUNC
FILTER_COLOR_FUNC_UNSAFE
Structs
FilterBrightness
- type
string<filter.FilterType>
- percent
float
FilterColorBalance
- type
string<filter.FilterType>
- percentRed
float
- percentGreen
float
- percentBlue
float
FilterColorize
- type
string<filter.FilterType>
- hue
float
- saturation
float
- percent
float
FilterColorspaceLinearToSRGB
- type
string<filter.FilterType>
FilterColorspaceSRGBToLinear
- type
string<filter.FilterType>
FilterContrast
- type
string<filter.FilterType>
- percent
float
FilterConvolution
- type
string<filter.FilterType>
- kernel
[]float
- normalize
bool
- alpha
bool
- abs
bool
- delta
float
FilterCrop
- type
string<filter.FilterType>
- xmin
int
- ymin
int
- xmax
int
- ymax
int
FilterCropToSize
- type
string<filter.FilterType>
- width
int
- height
int
- anchor
int<filter.Anchor>
FilterFlipHorizontal
- type
string<filter.FilterType>
FilterFlipVertical
- type
string<filter.FilterType>
FilterGamma
- type
string<filter.FilterType>
- gamma
float
FilterGaussianBlur
- type
string<filter.FilterType>
- sigma
float
FilterGrayscale
- type
string<filter.FilterType>
FilterInvert
- type
string<filter.FilterType>
FilterRotate
- type
string<filter.FilterType>
- angle
float
- bgcolor
struct<image.Color>
- interpolation
int<filter.Interpolation>
FilterRotate90
- type
string<filter.FilterType>
FilterRotate180
- type
string<filter.FilterType>
FilterRotate270
- type
string<filter.FilterType>
FilterHue
- type
string<filter.FilterType>
- shift
float
FilterSaturation
- type
string<filter.FilterType>
- percent
float
FilterSepia
- type
string<filter.FilterType>
- percent
float
FilterThreshold
- type
string<filter.FilterType>
- percent
float
FilterPixelate
- type
string<filter.FilterType>
- size
int
FilterTranspose
- type
string<filter.FilterType>
FilterTransverse
- type
string<filter.FilterType>
FilterSobel
- type
string<filter.FilterType>
FilterMaximum
- type
string<filter.FilterType>
- ksize
int
- disk
bool
FilterMean
- type
string<filter.FilterType>
- ksize
int
- disk
bool
FilterMedian
- type
string<filter.FilterType>
- ksize
int
- disk
bool
FilterMinimum
- type
string<filter.FilterType>
- ksize
int
- disk
bool
FilterSigmoid
- type
string<filter.FilterType>
- midpoint
float
- factor
float
FilterUnsharpMask
- type
string<filter.FilterType>
- sigma
float
- amount
float
- threshold
float
FilterResize
- type
string<filter.FilterType>
- width
int
- height
int
- resampling
int<filter.Resampling>
FilterResizeToFill
- type
string<filter.FilterType>
- width
int
- height
int
- resampling
int<filter.Resampling>
- anchor
int<filter.Anchor>
FilterResizeToFit
- type
string<filter.FilterType>
- width
int
- height
int
- resampling
int<filter.Resampling>
FilterColorFunc
- type
string<filter.FilterType>
- fn
function(r float, g float, b float, a float) -> float, float, float, float
FilterColorFuncUnsafe
- type
string<filter.FilterType>
- fn
function(r float, g float, b float, a float) -> float, float, float, float
Interfaces
Filter
- type
string<filter.FilterType>