Kinemium Docs

EditableImage

A mutable image that can be drawn onto and modified at runtime.

Properties

PropertyTypeDefault
SizeVector2Vector2.new(1024, 1024)
Namestring"EditableImage"

Functions

`instance:Destroy`

Cleans up the resources.

`instance:DrawCircle`

Draws a circle in the image.

`instance:DrawRectangle`

Draws a rectangle in the image.

`instance:DrawLine`

Draws a line in the image.

`instance:DrawImage`

Draws an image in the editable image.

`instance:DrawImageTransformed`

Draws a transformed image in the editable image.

`instance:DrawImageProjected`

Draws a projected image in the editable image.

`instance:ReadPixelsBuffer`

Returns pixels buffer

`instance:Sharpen`

Sharpens the image

`instance:WritePixelsBuffer`

Writes pixels buffer.

`instance:Clear`

Clears the image.

`instance:Fill`

Fills the image with a color and transparency.

`instance:DrawRectangleOutline`

Draws an outlined rectangle in the image.

`instance:Rotate`

Rotates the image.

`instance:FlipHorizontal`

Flips the image horizontally.

`instance:FlipVertical`

Flips the image vertically.

`instance:Flip`

Flips the image.

`instance:Crop`

Crops the image.

`instance:Resize`

Resizes the image to a new Vector2.

`instance:GetPixelColor`

Gets the Pixel Color at the inputted Position.

`instance:SetPixelColor`

Sets the Pixel Color.

`instance:Blur`

Blurs the image.

`instance:ApplyGrayscale`

Applies grayscale.

`instance:ApplyInvert`

Applies invert.

`instance:ApplyContrast`

Applies contrast.

`instance:ApplyBrightness`

Applies brightness.

`instance:DrawGradient`

Draws a gradient.

`instance:ExportToFile`

Exports to file.

`instance:GetDimensions`

Gets the Dimensions.

`instance:GetArea`

Gets the Area.

`instance:IsDirty`

Is it dirty?

`instance:MarkDirty`

Marks dirty.

`instance:ClearDirty`

Clears dirty.

`instance:DrawPixel`

Draws a pixel at the inputted position with color argument and an optional transparency.

`instance:DrawLineEx`

Draws a line in the image, with more customization options such as thickness.

`instance:DrawCircleLines`

Draws circle lines in the image.

`instance:DrawRectangleV`

Draws a rectangle in the image.

`instance:DrawRectangleLines`

Draws rectangle lines in the image.

`instance:DrawTriangle`

Draws a triangle in the image.

`instance:DrawTriangleEx`

Draws a triangle in the image, with more color options.

`instance:DrawTriangleLines`

Draws triangle lines in the image.

`instance:DrawText`

Draws text in the image.

`instance:DrawTextEx`

Draws text with more customization options.

`instance:ColorReplace`

Replaces the old color with a new color.

`instance:AlphaMask`

Alpha masks an image.

`instance:AlphaCrop`

Alpha crops with a threshold.

`instance:AlphaClear`

Alpha clears.

`instance:AlphaPremultiply`

Alpha premultiplies the image.

`instance:Dither`

Dithers the image.

`instance:GetImageAlphaBorder`

Gets the Image Alpha Border.


instance:Destroy

Cleans up the resources.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:DrawCircle

Draws a circle in the image.

Arguments

center: Vector2, radius: number, color: any, transparency: number, combineType: string

Returns

This function returns nothing.

instance:DrawRectangle

Draws a rectangle in the image.

Arguments

position: Vector2, size: Vector2, color: any, transparency: number, combineType: string

Returns

This function returns nothing.

instance:DrawLine

Draws a line in the image.

Arguments

p1: Vector2, p2: Vector2, color: any, transparency: number, combineType: string

Returns

This function returns nothing.

instance:DrawImage

Draws an image in the editable image.

Arguments

position: Vector2, imageInstance: any, combineType: string

Returns

This function returns nothing.

instance:DrawImageTransformed

Draws a transformed image in the editable image.

Arguments

position: Vector2, scale: Vector2, rotation: number, imageInstance: any, options: any

Returns

This function returns nothing.

instance:DrawImageProjected

Draws a projected image in the editable image.

Arguments

mesh: any, projection: any, brushConfig: any

Returns

This function returns nothing.

instance:ReadPixelsBuffer

Returns pixels buffer

Arguments

position: Vector2, size: Vector2

Returns

buffer

instance:Sharpen

Sharpens the image

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:WritePixelsBuffer

Writes pixels buffer.

Arguments

position: Vector2, size: Vector2, buf: buffer

Returns

This function returns nothing.

instance:Clear

Clears the image.

Arguments

color: any, transparency: number

Returns

This function returns nothing.

instance:Fill

Fills the image with a color and transparency.

Arguments

color: any, transparency: number

Returns

This function returns nothing.

instance:DrawRectangleOutline

Draws an outlined rectangle in the image.

Arguments

position: Vector2, size: Vector2, color: any, transparency: number, thickness: number

Returns

This function returns nothing.

instance:Rotate

Rotates the image.

Arguments

angle: number

Returns

This function returns nothing.

instance:FlipHorizontal

Flips the image horizontally.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:FlipVertical

Flips the image vertically.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:Flip

Flips the image.

Arguments

horizontal: boolean, vertical: boolean

Returns

This function returns nothing.

instance:Crop

Crops the image.

Arguments

position: Vector2, size: Vector2

Returns

This function returns nothing.

instance:Resize

Resizes the image to a new Vector2.

Arguments

newSize: Vector2

Returns

This function returns nothing.

instance:GetPixelColor

Gets the Pixel Color at the inputted Position.

Arguments

position: Vector2

Returns

any

instance:SetPixelColor

Sets the Pixel Color.

Arguments

position: Vector2, color: any, transparency: number

Returns

This function returns nothing.

instance:Blur

Blurs the image.

Arguments

strength: number

Returns

This function returns nothing.

instance:ApplyGrayscale

Applies grayscale.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:ApplyInvert

Applies invert.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:ApplyContrast

Applies contrast.

Arguments

contrast: number

Returns

This function returns nothing.

instance:ApplyBrightness

Applies brightness.

Arguments

brightness: number

Returns

This function returns nothing.

instance:DrawGradient

Draws a gradient.

Arguments

fromPos: Vector2, toPos: Vector2, color1: any, color2: any, transparency: number

Returns

This function returns nothing.

instance:ExportToFile

Exports to file.

Arguments

filepath: string

Returns

This function returns nothing.

instance:GetDimensions

Gets the Dimensions.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:GetArea

Gets the Area.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:IsDirty

Is it dirty?

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:MarkDirty

Marks dirty.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:ClearDirty

Clears dirty.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:DrawPixel

Draws a pixel at the inputted position with color argument and an optional transparency.

Arguments

position: Vector2, color: any, transparency: number

Returns

This function returns nothing.

instance:DrawLineEx

Draws a line in the image, with more customization options such as thickness.

Arguments

p1: Vector2, p2: Vector2, thickness: number, color: any, transparency: number

Returns

This function returns nothing.

instance:DrawCircleLines

Draws circle lines in the image.

Arguments

center: Vector2, radius: number, color: any, transparency: number

Returns

This function returns nothing.

instance:DrawRectangleV

Draws a rectangle in the image.

Arguments

position: Vector2, size: Vector2, color: any, transparency: number

Returns

This function returns nothing.

instance:DrawRectangleLines

Draws rectangle lines in the image.

Arguments

position: Vector2, size: Vector2, thickness: number, color: any, transparency: number

Returns

This function returns nothing.

instance:DrawTriangle

Draws a triangle in the image.

Arguments

v1: Vector2, v2: Vector2, v3: Vector2, color: any, transparency: number

Returns

This function returns nothing.

instance:DrawTriangleEx

Draws a triangle in the image, with more color options.

Arguments

v1: Vector2, v2: Vector2, v3: Vector2, color1: any, color2: any, color3: any, transparency: number

Returns

This function returns nothing.

instance:DrawTriangleLines

Draws triangle lines in the image.

Arguments

v1: Vector2, v2: Vector2, v3: Vector2, color: any, transparency: number

Returns

This function returns nothing.

instance:DrawText

Draws text in the image.

Arguments

text: string, position: Vector2, fontSize: number, color: any, transparency: number

Returns

This function returns nothing.

instance:DrawTextEx

Draws text with more customization options.

Arguments

font: any, text: string, position: Vector2, fontSize: number, spacing: number, color: any, transparency: number

Returns

This function returns nothing.

instance:ColorReplace

Replaces the old color with a new color.

Arguments

oldColor: any, newColor: any

Returns

This function returns nothing.

instance:AlphaMask

Alpha masks an image.

Arguments

alphaMaskImage: any

Returns

This function returns nothing.

instance:AlphaCrop

Alpha crops with a threshold.

Arguments

alphaThreshold: number

Returns

This function returns nothing.

instance:AlphaClear

Alpha clears.

Arguments

color: any, transparency: number

Returns

This function returns nothing.

instance:AlphaPremultiply

Alpha premultiplies the image.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

instance:Dither

Dithers the image.

Arguments

rBpp: number, gBpp: number, bBpp: number, aBpp: number

Returns

This function returns nothing.

instance:GetImageAlphaBorder

Gets the Image Alpha Border.

Arguments

This function takes no arguments.

Returns

This function returns nothing.

API

instance:Destroy()
instance:DrawCircle(center: Vector2, radius: number, color: any, transparency: number, combineType: string)
instance:DrawRectangle(position: Vector2, size: Vector2, color: any, transparency: number, combineType: string)
instance:DrawLine(p1: Vector2, p2: Vector2, color: any, transparency: number, combineType: string)
instance:DrawImage(position: Vector2, imageInstance: any, combineType: string)
instance:DrawImageTransformed(position: Vector2, scale: Vector2, rotation: number, imageInstance: any, options: any)
instance:DrawImageProjected(mesh: any, projection: any, brushConfig: any)
instance:ReadPixelsBuffer(position: Vector2, size: Vector2): buffer
instance:Sharpen()
instance:WritePixelsBuffer(position: Vector2, size: Vector2, buf: buffer)
instance:Clear(color: any, transparency: number)
instance:Fill(color: any, transparency: number)
instance:DrawRectangleOutline(position: Vector2, size: Vector2, color: any, transparency: number, thickness: number)
instance:Rotate(angle: number)
instance:FlipHorizontal()
instance:FlipVertical()
instance:Flip(horizontal: boolean, vertical: boolean)
instance:Crop(position: Vector2, size: Vector2)
instance:Resize(newSize: Vector2)
instance:GetPixelColor(position: Vector2): any
instance:SetPixelColor(position: Vector2, color: any, transparency: number)
instance:Blur(strength: number)
instance:ApplyGrayscale()
instance:ApplyInvert()
instance:ApplyContrast(contrast: number)
instance:ApplyBrightness(brightness: number)
instance:DrawGradient(fromPos: Vector2, toPos: Vector2, color1: any, color2: any, transparency: number)
instance:ExportToFile(filepath: string)
instance:GetDimensions()
instance:GetArea()
instance:IsDirty()
instance:MarkDirty()
instance:ClearDirty()
instance:DrawPixel(position: Vector2, color: any, transparency: number)
instance:DrawLineEx(p1: Vector2, p2: Vector2, thickness: number, color: any, transparency: number)
instance:DrawCircleLines(center: Vector2, radius: number, color: any, transparency: number)
instance:DrawRectangleV(position: Vector2, size: Vector2, color: any, transparency: number)
instance:DrawRectangleLines(position: Vector2, size: Vector2, thickness: number, color: any, transparency: number)
instance:DrawTriangle(v1: Vector2, v2: Vector2, v3: Vector2, color: any, transparency: number)
instance:DrawTriangleEx(v1: Vector2, v2: Vector2, v3: Vector2, color1: any, color2: any, color3: any, transparency: number)
instance:DrawTriangleLines(v1: Vector2, v2: Vector2, v3: Vector2, color: any, transparency: number)
instance:DrawText(text: string, position: Vector2, fontSize: number, color: any, transparency: number)
instance:DrawTextEx(font: any, text: string, position: Vector2, fontSize: number, spacing: number, color: any, transparency: number)
instance:ColorReplace(oldColor: any, newColor: any)
instance:AlphaMask(alphaMaskImage: any)
instance:AlphaCrop(alphaThreshold: number)
instance:AlphaClear(color: any, transparency: number)
instance:AlphaPremultiply()
instance:Dither(rBpp: number, gBpp: number, bBpp: number, aBpp: number)
instance:GetImageAlphaBorder()

On this page