Divooka.DSL.ImageProcessing
Divooka.DSL.ImageProcessing.ImageConversionHelper.ConvertFromSKImage()
Converts an SKImage (from SkiaSharp) directly into a Divooka.Types.Image.
Parameters
| Name | Description | Default |
|---|---|---|
skImage |
The source SKImage. |
Returns
A Divooka.Types.Image built from the SKImage's pixel data.
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing
A stateless pipeline builder that relies on final "preview/render" to get the actual image result. Otherwise this is (like LINQ) just a pipeline builder that doesn't do any processing.
A proper use of this class/framework should generally be "stateless" - like configuring slide presents. That way the actual image data loading and processing only happens "at the end" and thus we can be very efficient from API perspective - unlike OneShotProcessing.
Remarks
TODO: Not tested as of 2025-02-17.
Majority of the code generated with ChatGPT.
The current implementation differs to OneShotProcessing mostly in the use of CG kernels and SkiaSharp rather than ImageMagick, but the API/framework is just wrong (see note below and above).
TODO: Merge existing code into OneShotProcessing - they are wrong and NOT what ImageProcessor should do. E.g. "Returns a new ImageProcessor with brightness adjusted" is completely useless - why don't we just return the PixelImage then?
Remark: It's not exactly wrong - it's an extension of PixelImage. So it is doing what it's intended to do.
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.#ctor()
Load and initialize base properties based on image file type.
Parameters
| Name | Description | Default |
|---|---|---|
imagePath |
Path of the image file. Many extensions are supported. |
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.Grayscale
Returns a new ImageProcessor with the image converted to grayscale.
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.Invert
Returns a new ImageProcessor where the colors are inverted.
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.AdjustBrightness()
Returns a new ImageProcessor with brightness adjusted.
Parameters
| Name | Description | Default |
|---|---|---|
value |
Brightness offset in [-255..255]. |
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.AdjustContrast()
Returns a new ImageProcessor with contrast adjusted.
Parameters
| Name | Description | Default |
|---|---|---|
contrast |
Contrast factor where 1 is no change. |
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.AdjustSaturation()
Returns a new ImageProcessor with saturation adjusted.
Parameters
| Name | Description | Default |
|---|---|---|
saturation |
Saturation factor where 1 is no change. |
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.HueShift()
Returns a new ImageProcessor with hue shifted by the specified degrees.
Parameters
| Name | Description | Default |
|---|---|---|
degrees |
Degrees to shift hue. Negative values shift backward. |
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.Blur()
Returns a new ImageProcessor with a Gaussian blur applied.
Parameters
| Name | Description | Default |
|---|---|---|
radius |
Blur radius. |
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.Sharpen()
Returns a new ImageProcessor with a sharpen effect applied.
Parameters
| Name | Description | Default |
|---|---|---|
amount |
Sharpen intensity. |
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.Resize()
Returns a new ImageProcessor with the image resized to the specified width and height.
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.Rotate()
Returns a new ImageProcessor with the image rotated by the specified degrees.
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.Crop()
Returns a new ImageProcessor containing a cropped region of the image.
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.ToSKBitmap
Converts the current PixelImage (i.e. Pixel[][]) to an SKBitmap.
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.LoadPixelsFromFile()
Uses SkiaSharp to decode the file into a 2D pixel array.
Divooka.DSL.ImageProcessing.EnhancedPixelImageWithSkiaSharpImageProcessing.CreateTempPngFromOtherFormat()
Remarks
Used to initialize image processor using both/either BigGustave or SkiaSharp.
If the file is already a PNG, use it directly; otherwise convert using SkiaSharp: base((Path.GetExtension(imagePath).ToLowerInvariant() == ".png") ? imagePath : CreateTempPngFromOtherFormat(imagePath), doNotLoad: true)
Divooka.DSL.ImageProcessing.Frameworks.ImageComposer
Provides a simple mechanism for layout pixel images. It can be used for slide creation, reporting, even animation frame composition purposes.
Automatically calculates overall bounds.
Divooka.DSL.ImageProcessing.Frameworks.ImageComposer.ImageCompositionFormattingParameters.ImageTitle
Title of the final composition
Divooka.DSL.ImageProcessing.Frameworks.ImageComposer.ConfigureComposition()
Create a configuration for ScatterPlot
Divooka.DSL.ImageProcessing.Frameworks.ImageComposer.PlaceImage()
Designates the placement of image.
Parameters
| Name | Description | Default |
|---|---|---|
image |
The image to place. | |
position |
Position of the image. Nagative and positive values will automatically expand the final canvas. | |
borderWidth |
Optional border for the image; Use 0 to disable border. | |
scaleRatio |
Whether we should scale the image. |
Returns
A placement specification for the image, which can be previewed directly in preview node or output window.
Divooka.DSL.ImageProcessing.ImageFileFormatConversion
Deals with file format conversion on the file level (file system level operations)
Divooka.DSL.ImageProcessing.ImageFileFormatConversion.Convert()
This simple function replaces lots of external file conversion utilities.
Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer
A static helper for applying “Instagram/Lightroom-style” one-shot preset filters to images.
Remarks
Currently very slow - e.g. on a 5kx3k photo, applying a style tooks around 5-6s on average, among which 1/3 of the time is wasted on PixelImage-MagickImage conversion.
To improve performance, wait till we have a new ImageProcessor pipeline setup. (Currently by making use of Magick functions natively we are already as fast as we can go)
Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer.PhotoStyle
Specifies various preset styles for quick photo stylization.
Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer.ApplyStyle()
Applies the specified Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer.PhotoStyle to a given Divooka.Multimedia.Image.PixelImage.
Parameters
| Name | Description | Default |
|---|---|---|
image |
The source Divooka.Multimedia.Image.PixelImage. | |
style |
The style preset to apply. |
Returns
A new Divooka.Multimedia.Image.PixelImage after applying the chosen style.
Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer.ApplyStyle()
An overload that reads a file from disk, applies a style, and returns a new Divooka.Multimedia.Image.PixelImage.
Parameters
| Name | Description | Default |
|---|---|---|
inputPath |
Path to the source image file. | |
style |
The style preset to apply. |
Returns
A new Divooka.Multimedia.Image.PixelImage after applying the chosen style.
Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer.ApplyLomoStyle()
Simulates a "Lomo" (toy camera) effect: high saturation + vignette.
Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer.ApplyCinematicStyle()
Simulates a "Cinematic" effect, typically with boosted contrast and a teal/orange tint.
Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer.ApplyPastelStyle()
Produces a pastel-like effect by softening contrast, partially desaturating,
brightening, and optionally adding a light color overlay.
Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer.ApplyHDRLookStyle()
Simulates an "HDR" look by boosting detail in shadows and highlights, then optionally
increasing overall contrast. This is a simplified approach using sigmoidal contrast.
Divooka.DSL.ImageProcessing.ImageFilters.PhotoStylizer.ApplyPolaroidStyle()
Applies a "Polaroid" style effect by calling Magick.NET's built-in Polaroid method.
Also performs a slight fade to emulate an old photo look.
Divooka.DSL.ImageProcessing.OneShotProcessing
Provides one-shot image processing methods using Magick.NET.
Divooka.DSL.ImageProcessing.OneShotProcessing.FlipImageHorizontally()
Flips the image horizontally (mirrors it left-to-right).
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image file. | |
outputImage |
The path where the transformed image will be saved. |
Divooka.DSL.ImageProcessing.OneShotProcessing.FlipImageHorizontally()
Flips the image horizontally (mirrors it left-to-right).
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The original image data. |
Returns
Resulting image
Divooka.DSL.ImageProcessing.OneShotProcessing.FlipImageVertically()
Flips the image vertically (mirrors it top-to-bottom).
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image file. | |
outputImage |
The path where the transformed image will be saved. |
Divooka.DSL.ImageProcessing.OneShotProcessing.FlipImageVertically()
Flips the image vertically (mirrors it top-to-bottom).
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source image in Divooka.Multimedia.Image.PixelImage format. |
Returns
A new Divooka.Multimedia.Image.PixelImage that has been flipped vertically.
Divooka.DSL.ImageProcessing.OneShotProcessing.RotateImageClockwise90Degrees()
Rotates the image 90 degrees clockwise.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image file. | |
outputImage |
The path where the transformed image will be saved. |
Divooka.DSL.ImageProcessing.OneShotProcessing.RotateImageClockwise90Degrees()
Rotates the image 90 degrees clockwise.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source image in Divooka.Multimedia.Image.PixelImage format. |
Returns
A new Divooka.Multimedia.Image.PixelImage rotated 90 degrees clockwise.
Divooka.DSL.ImageProcessing.OneShotProcessing.RotateImageCounterclockwise90Degrees()
Rotates the image 90 degrees counterclockwise.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image file. | |
outputImage |
The path where the transformed image will be saved. |
Divooka.DSL.ImageProcessing.OneShotProcessing.RotateImageCounterclockwise90Degrees()
Rotates the image 90 degrees counterclockwise.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source image in Divooka.Multimedia.Image.PixelImage format. |
Returns
A new Divooka.Multimedia.Image.PixelImage rotated 90 degrees counterclockwise.
Divooka.DSL.ImageProcessing.OneShotProcessing.ResizeImage()
Resizes the image to the specified width while maintaining the aspect ratio.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image file. | |
outputImage |
The path to the output image file. | |
newWidth |
The new width for the image. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ResizeImage()
Resizes the image to the specified width while maintaining the aspect ratio.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source image in Divooka.Multimedia.Image.PixelImage format. | |
newWidth |
The new width for the image. |
Returns
A new Divooka.Multimedia.Image.PixelImage that has been resized proportionally.
Divooka.DSL.ImageProcessing.OneShotProcessing.ResizeImage()
Resizes the image to the specified width and adjusts the height to match the desired size by cropping or filling as needed.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image file. | |
outputImage |
The path to the output image file. | |
newWidth |
The new width for the image. | |
newHeight |
The new height for the image. | |
fillColor |
The fill color to use if the resized image's height is less than the desired height. If the resized image is taller than desired, it is center-cropped. Defaults to white if not provided. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ResizeImage()
Resizes the image to the specified width and adjusts the height by cropping or filling.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source image in Divooka.Multimedia.Image.PixelImage format. | |
newWidth |
The desired width. | |
newHeight |
The desired height. | |
fillColor |
The fill color to use if the resized image's height is less than the desired height. If the resized image is taller than desired, it is center-cropped. Defaults to white if not provided. |
Returns
A new Divooka.Multimedia.Image.PixelImage with the requested dimensions.
Divooka.DSL.ImageProcessing.OneShotProcessing.CropImage()
Crops the image to the specified rectangle. If the crop area exceeds the bounds of the original image,
the missing regions are filled with the specified fill color.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image file. | |
outputImage |
The path to the output image file. | |
offsetX |
The X offset (in pixels) where cropping should begin. | |
offsetY |
The Y offset (in pixels) where cropping should begin. | |
cropWidth |
The width (in pixels) of the crop area. | |
cropHeight |
The height (in pixels) of the crop area. | |
fillColor |
The fill color to use for areas outside the bounds of the original image. Defaults to white if not provided. |
Divooka.DSL.ImageProcessing.OneShotProcessing.CropImage()
Crops the image to the specified rectangle. If the crop area exceeds the original bounds,
the missing regions are filled with the specified color.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
offsetX |
The X offset from the top-left corner. | |
offsetY |
The Y offset from the top-left corner. | |
cropWidth |
The width of the crop area. | |
cropHeight |
The height of the crop area. | |
fillColor |
The fill color to use outside original bounds (defaults to white). |
Returns
A new Divooka.Multimedia.Image.PixelImage that has been cropped.
Divooka.DSL.ImageProcessing.OneShotProcessing.CropImage()
Crops the image to the specified rectangle defined by an offset vector and size.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image file. | |
outputImage |
The path to the output image file. | |
offset |
The offset (in pixels) where cropping should begin. | |
cropSize |
The size (in pixels) of the crop area. | |
fillColor |
The fill color to use for areas outside the original image bounds. |
Divooka.DSL.ImageProcessing.OneShotProcessing.CropImage()
Crops the image to the specified rectangle using an offset vector and size.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
offset |
The offset (in pixels) from the top-left corner. | |
cropSize |
The width and height of the crop. | |
fillColor |
The fill color for areas outside the original image bounds. |
Returns
A new Divooka.Multimedia.Image.PixelImage that has been cropped.
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustBrightnessContrast()
Adjusts the brightness and contrast of the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
outputImage |
Path for the output image. | |
brightness |
The brightness adjustment in percentage. 0 means no change; positive values brighten and negative values darken. | |
contrast |
The contrast adjustment in percentage. 0 means no change; positive values increase contrast and negative values decrease contrast. |
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustBrightnessContrast()
Adjusts the brightness and contrast of the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
brightness |
The brightness change in percentage (negative darkens, positive brightens). | |
contrast |
The contrast change in percentage (negative decreases, positive increases). |
Returns
A new Divooka.Multimedia.Image.PixelImage with adjusted brightness and contrast.
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustSaturation()
Adjusts the saturation of the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
outputImage |
Path for the output image. | |
saturation |
The saturation level as a percentage. 100 leaves the image unchanged; values above 100 increase saturation, while values below 100 decrease it. |
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustSaturation()
Adjusts the saturation of the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
saturation |
The saturation level as a percentage. 100 means no change; values above 100 increase saturation, while values below 100 decrease it. |
Returns
A new Divooka.Multimedia.Image.PixelImage with the adjusted saturation.
Divooka.DSL.ImageProcessing.OneShotProcessing.AddBackgroud()
Adds a solid-colored background behind any transparent pixels in the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
background |
The background fill color. If null, defaults to white. | White |
Returns
A new Divooka.Multimedia.Image.PixelImage with the background added.
Divooka.DSL.ImageProcessing.OneShotProcessing.AddBackgroudSkia()
Alternative implementation.
Divooka.DSL.ImageProcessing.OneShotProcessing.GaussianBlur()
Applies a Gaussian blur to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
radius |
The blur radius. | |
sigma |
The standard deviation (sigma) for the blur. |
Divooka.DSL.ImageProcessing.OneShotProcessing.GaussianBlur()
Applies a Gaussian blur to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
radius |
The blur radius. | |
sigma |
The blur sigma (standard deviation). |
Returns
A blurred Divooka.Multimedia.Image.PixelImage.
Divooka.DSL.ImageProcessing.OneShotProcessing.MotionBlur()
Applies a motion blur to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
radius |
The blur radius. | |
sigma |
The standard deviation (sigma) for the blur. | |
angle |
The angle of the motion blur (in degrees). |
Divooka.DSL.ImageProcessing.OneShotProcessing.MotionBlur()
Applies a motion blur to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
radius |
The blur radius. | |
sigma |
The blur sigma (standard deviation). | |
angle |
The motion blur angle in degrees. |
Returns
A Divooka.Multimedia.Image.PixelImage with a motion blur effect.
Divooka.DSL.ImageProcessing.OneShotProcessing.Sharpen()
Sharpens the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
radius |
The radius for the sharpen effect. | |
sigma |
The sigma for the sharpen effect. |
Divooka.DSL.ImageProcessing.OneShotProcessing.Sharpen()
Sharpens the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
radius |
The sharpening radius. | |
sigma |
The sharpening sigma. |
Returns
A Divooka.Multimedia.Image.PixelImage with enhanced sharpness.
Divooka.DSL.ImageProcessing.OneShotProcessing.UnsharpMask()
Applies an unsharp mask to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
radius |
The radius for the unsharp mask. | |
sigma |
The sigma for the unsharp mask. | |
amount |
The amount of sharpening. | |
threshold |
The threshold for the unsharp mask. |
Divooka.DSL.ImageProcessing.OneShotProcessing.UnsharpMask()
Applies an unsharp mask to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
radius |
The radius for the unsharp mask. | |
sigma |
The sigma for the unsharp mask. | |
amount |
The amount of sharpening. | |
threshold |
The threshold for the unsharp mask. |
Returns
A Divooka.Multimedia.Image.PixelImage that has undergone unsharp masking.
Divooka.DSL.ImageProcessing.OneShotProcessing.RecolorImage()
Recolors the image by overlaying the specified color with the given opacity.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
outputImage |
Path for the output image. | |
overlayColor |
The color to overlay on the image. | |
opacity |
The opacity of the overlay in percentage. 0 makes the overlay fully transparent, while 100 makes it fully opaque. |
Divooka.DSL.ImageProcessing.OneShotProcessing.RecolorImage()
Recolors the image by overlaying the specified color at a given opacity.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
overlayColor |
The color to overlay on the image. | |
opacity |
The opacity of the overlay in percentage. 0 is fully transparent, 100 is fully opaque. |
Returns
A new Divooka.Multimedia.Image.PixelImage after recoloring.
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyLUT()
Applies a lookup table (LUT) to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
lutImage |
Path to the LUT image. | |
outputImage |
Path for the output image. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyLUT()
Applies a lookup table (LUT) image to the source image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
lutImage |
A Divooka.Multimedia.Image.PixelImage acting as the LUT. |
Returns
A new Divooka.Multimedia.Image.PixelImage after LUT is applied.
Divooka.DSL.ImageProcessing.OneShotProcessing.ReduceNoise()
Reduces noise in the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
order |
The size for noise reduction. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ReduceNoise()
Reduces noise in the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
order |
The size used for noise reduction. |
Returns
A Divooka.Multimedia.Image.PixelImage with reduced noise.
Divooka.DSL.ImageProcessing.OneShotProcessing.ConvertToGrayscale()
Converts the image to grayscale.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
outputImage |
Path for the output image. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ConvertToGrayscale()
Converts the image to grayscale.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. |
Returns
A new Divooka.Multimedia.Image.PixelImage in grayscale.
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustHSL()
Adjusts the image using HSL (Hue, Saturation, Luminance) values.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
outputImage |
Path for the output image. | |
hue |
The hue adjustment value in degrees. | |
saturation |
The saturation level as a percentage. 100 means no change. | |
luminance |
The luminance (brightness) level as a percentage. 100 means no change. |
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustHSL()
Adjusts the image using HSL (Hue, Saturation, Luminance) values.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
hue |
The hue shift in degrees (0-360 typical). | |
saturation |
The saturation in percentage (100 is no change). | |
luminance |
The luminance in percentage (100 is no change). |
Returns
A Divooka.Multimedia.Image.PixelImage with adjusted HSL values.
Divooka.DSL.ImageProcessing.OneShotProcessing.GammaCorrection()
Applies gamma correction to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
gamma |
The gamma value to apply (typically between 0.1 and 3.0). |
Divooka.DSL.ImageProcessing.OneShotProcessing.GammaCorrection()
Applies gamma correction to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
gamma |
The gamma value to apply (commonly between 0.1 and 3.0). |
Returns
A new Divooka.Multimedia.Image.PixelImage after gamma correction.
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustLevels()
Adjusts the levels of the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
blackPoint |
The black point value. | |
whitePoint |
The white point value. | |
gamma |
The gamma correction value. |
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustLevels()
Adjusts the levels of the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
blackPoint |
The black point (0-255 in Q8). | |
whitePoint |
The white point (0-255 in Q8). | |
gamma |
The gamma correction factor. |
Returns
A new Divooka.Multimedia.Image.PixelImage with adjusted levels.
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustShadowsHighlights()
Adjusts the shadows and highlights of the image using sigmoidal contrast.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
outputImage |
Path for the output image. | |
shadows |
The amount to adjust the shadows. Use positive values to boost shadow contrast and negative values to soften them. | |
highlights |
The amount to adjust the highlights. Use positive values to boost highlight contrast and negative values to soften them. |
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustShadowsHighlights()
Adjusts the shadows and highlights of the image using sigmoidal contrast.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
shadows |
Amount to adjust the shadows (positive or negative). | |
highlights |
Amount to adjust the highlights (positive or negative). |
Returns
A Divooka.Multimedia.Image.PixelImage with adjusted shadows/highlights.
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyPerspectiveDistortion()
Applies a perspective distortion to the image using control points.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
controlPoints |
An array of doubles representing source and destination coordinate pairs. The array must contain exactly 16 elements in the following order: srcX1, srcY1, dstX1, dstY1, srcX2, srcY2, dstX2, dstY2, srcX3, srcY3, dstX3, dstY3, srcX4, srcY4, dstX4, dstY4. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyPerspectiveDistortion()
Applies a perspective distortion using four source and four destination points.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
controlPoints |
An array of 16 doubles: (srcX1, srcY1, dstX1, dstY1, srcX2, srcY2, dstX2, dstY2, srcX3, srcY3, dstX3, dstY3, srcX4, srcY4, dstX4, dstY4). |
Returns
A Divooka.Multimedia.Image.PixelImage after perspective distortion.
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustSelectiveSaturation()
Adjusts the saturation selectively for regions matching the target color within a given tolerance.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
targetColor |
The target color for selective adjustment. | |
tolerance |
The tolerance as a ImageMagick.Percentage (e.g. new Percentage(10) for 10%). | |
saturation |
The saturation level as a percentage to apply on the selected areas. 100 means no change; values above 100 increase saturation, while below decrease it. |
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustSelectiveSaturation()
Adjusts the saturation selectively for regions matching the target color within a tolerance.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
targetColor |
The color to selectively adjust. | |
tolerance |
The tolerance as a ImageMagick.Percentage. | |
saturation |
The saturation level as a percentage. 100 means no change; values above 100 increase saturation, below 100 decrease it. |
Returns
A new Divooka.Multimedia.Image.PixelImage with selectively adjusted saturation.
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyVignette()
Applies a vignette effect to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
radius |
The radius for the vignette effect. | |
sigma |
The sigma for the vignette effect. | |
x |
The x ellipse offset. | |
y |
The y ellipse offset. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyVignette()
Applies a vignette effect to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
radius |
The vignette radius. | |
sigma |
The vignette sigma. | |
x |
The x offset for the vignette ellipse. | |
y |
The y offset for the vignette ellipse. |
Returns
A Divooka.Multimedia.Image.PixelImage with a vignette effect.
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyEmboss()
Applies an emboss effect to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
radius |
The radius for the emboss effect. | |
sigma |
The sigma for the emboss effect. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyEmboss()
Applies an emboss effect to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
radius |
The emboss radius. | |
sigma |
The emboss sigma. |
Returns
A Divooka.Multimedia.Image.PixelImage with an embossed appearance.
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyOilPaintEffect()
Applies an oil paint effect to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The path to the original image. | |
outputImage |
The path for the output image. | |
radius |
The radius for the oil paint effect. | |
sigma |
The sigma for the oil paint effect. The standard deviation of Laplatian, in pixels. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ApplyOilPaintEffect()
Applies an oil paint effect to the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
radius |
The radius for the oil paint effect. | |
sigma |
The sigma for the oil paint effect. |
Returns
A Divooka.Multimedia.Image.PixelImage that looks "oil-painted".
Divooka.DSL.ImageProcessing.OneShotProcessing.SoftFocus()
Applies a soft-focus or partial blur effect to the image by compositing a blurred copy
with a radial gradient mask. Areas closer to the edges become more blurred,
while the center remains in focus.
Remarks
The radial mask can be replaced or customized for different blur placements
(e.g., a linear gradient for tilt-shift effects). Increase blurRadius
or blurSigma for a stronger blur. For a subtler look, reduce the
gradient’s transition in the mask or lower the blur parameters.
Parameters
| Name | Description | Default |
|---|---|---|
original |
The source image in Divooka.Multimedia.Image.PixelImage format. | |
blurRadius |
The radius of the Gaussian blur. | |
blurSigma |
The sigma (standard deviation) of the Gaussian blur. |
Returns
A new Divooka.Multimedia.Image.PixelImage that has a soft-focus effect.
Divooka.DSL.ImageProcessing.OneShotProcessing.SelectiveColorShift()
Selectively shifts the hue of pixels matching a target color within a given tolerance (fuzz),
allowing specific colors to be hue-shifted while leaving others unchanged.
Remarks
For best results, choose fuzz carefully to isolate your
target color without affecting nearby colors. You may also consider applying
additional threshold or color-based adjustments if the region you want to shift
is very similar to other colors.
Parameters
| Name | Description | Default |
|---|---|---|
original |
The source image in Divooka.Multimedia.Image.PixelImage format. | |
targetColor |
The Divooka.Multimedia.Image.Color to match/shift. | |
hueShiftDegrees |
The amount to shift the hue, in degrees (e.g., 180 would invert hues). | |
fuzz |
The tolerance for matching the target color. Higher values allow more color variation to be shifted. |
Returns
A new Divooka.Multimedia.Image.PixelImage with selectively hue-shifted regions.
Divooka.DSL.ImageProcessing.OneShotProcessing.ChannelTint()
Applies a channel tint by multiplying each of the red, green, and blue channels
by the specified factor, allowing for overall color shifts or enhancements.
Remarks
Common use-cases include warming the image by increasing the red factor slightly
(e.g., 1.1) or cooling it by boosting blue (e.g., 1.2). Keep the other factors at
1.0 if you only want to tint a specific channel. Very high or low factors can
clip highlights/shadows.
Parameters
| Name | Description | Default |
|---|---|---|
original |
The source image in Divooka.Multimedia.Image.PixelImage format. | |
redFactor |
The multiplier for the red channel. | |
greenFactor |
The multiplier for the green channel. | |
blueFactor |
The multiplier for the blue channel. |
Returns
A new Divooka.Multimedia.Image.PixelImage with the adjusted channel intensities.
Divooka.DSL.ImageProcessing.OneShotProcessing.AddFilmGrain()
Adds a film grain or noise layer over the image, emulating a vintage or analog appearance.
Remarks
Try different noiseType values and opacity to emulate
various film stocks or analog looks. Composite operators like ImageMagick.CompositeOperator.SoftLight
or ImageMagick.CompositeOperator.Overlay can change how the grain blends into
the underlying pixels. Adjusting the base color of the noise layer (e.g., not just gray)
can produce colored film grain.
Parameters
| Name | Description | Default |
|---|---|---|
original |
The source image in Divooka.Multimedia.Image.PixelImage format. | |
noiseType |
The type of noise to add (e.g., ImageMagick.NoiseType.Gaussian or ImageMagick.NoiseType.MultiplicativeGaussian). | |
opacity |
The strength or visibility of the added grain, expressed as a percentage of full opacity (0–100). |
Returns
A new Divooka.Multimedia.Image.PixelImage with an overlayed film-grain noise layer.
Divooka.DSL.ImageProcessing.OneShotProcessing.Pixelate()
Gives the image a retro, pixel-art look by grouping pixels into blocks of size²
and painting each block with its average colour. The final bitmap keeps the original resolution.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Source image data. | |
size |
The block width/height in pixels (minimum = 1). Larger values → chunkier pixels. Default = 4. |
Returns
A new Divooka.Multimedia.Image.PixelImage with the pixel-art effect applied.
Divooka.DSL.ImageProcessing.OneShotProcessing.PixelateCircle()
Pixel-art effect that replaces every size×size block
with a filled circle, giving a dotted-mosaic look.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Source bitmap. | |
size |
Side length of each logical block (≥ 1). | |
background |
Canvas colour – everything outside the dots. Null ➜ transparent. | |
margin |
Padding between the circle and the edge of its block. 0 means the circle just touches its neighbours; margin × 2 must be < size. |
Returns
A new Divooka.Multimedia.Image.PixelImage with the circle-pixel effect applied.
Divooka.DSL.ImageProcessing.OneShotProcessing.SepiaTone()
Converts the image to sepia using the built-in Magick.NET sepia tone method.
Parameters
| Name | Description | Default |
|---|---|---|
originalPath |
Path to the original image file. | |
outputPath |
Path where the sepia-toned image will be saved. | |
threshold |
A threshold value for the sepia effect (typical range: 0–100). Higher values produce a more pronounced sepia. |
Divooka.DSL.ImageProcessing.OneShotProcessing.SepiaTone()
Converts the image to sepia using the built-in Magick.NET sepia tone method.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
threshold |
A threshold value for the sepia effect (typical range: 0–100). Higher values produce more pronounced sepia. |
Returns
A new Divooka.Multimedia.Image.PixelImage in sepia tone.
Divooka.DSL.ImageProcessing.OneShotProcessing.HighContrastBAndW()
Applies a high-contrast black-and-white effect.
Parameters
| Name | Description | Default |
|---|---|---|
originalPath |
Path to the original image file. | |
outputPath |
Path where the stylized image will be saved. | |
contrastBoost |
The contrast boost percentage (0 means no change; typical range is 10–50). |
Divooka.DSL.ImageProcessing.OneShotProcessing.HighContrastBAndW()
Applies a high-contrast black-and-white effect.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
contrastBoost |
The contrast boost percentage (0 means no change; typical range is 10-50 for noticeable effect). |
Returns
A new Divooka.Multimedia.Image.PixelImage with high-contrast black-and-white style.
Divooka.DSL.ImageProcessing.OneShotProcessing.BleachBypass()
Creates a Bleach Bypass effect by partially desaturating the image and boosting contrast.
Parameters
| Name | Description | Default |
|---|---|---|
originalPath |
Path to the original image file. | |
outputPath |
Path where the stylized image will be saved. | |
desatPercentage |
How much to desaturate the image (0 = no desaturation, 100 = fully grayscale). | |
contrastBoost |
Additional contrast to apply afterward (0 = no change). |
Divooka.DSL.ImageProcessing.OneShotProcessing.BleachBypass()
Creates a Bleach Bypass effect by partially desaturating the image and boosting contrast.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
desatPercentage |
How much to desaturate the image (0 = no desaturation, 100 = fully grayscale). | |
contrastBoost |
Additional contrast to apply afterward (0 = no change). |
Returns
A new Divooka.Multimedia.Image.PixelImage that simulates Bleach Bypass.
Divooka.DSL.ImageProcessing.OneShotProcessing.AddText()
Adds the specified text to the image at the given location.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
outputImage |
Path for the output image. | |
text |
The text to add. | |
location |
The location (in pixels) where the text should be drawn. | |
font |
The font family name to use. | |
fontSize |
The font size. | |
color |
The color of the text. |
Divooka.DSL.ImageProcessing.OneShotProcessing.AddText()
Adds text to the image at the specified location.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
text |
The text to add. | |
location |
The location (in pixels) where the text should be drawn. | |
font |
The font family name to use. | |
fontSize |
The font size. | |
color |
The color of the text. |
Returns
A new Divooka.Multimedia.Image.PixelImage containing the rendered text.
Divooka.DSL.ImageProcessing.OneShotProcessing.CompositeImages()
Composites an overlay image onto a base image using the specified composite operator and offset.
Parameters
| Name | Description | Default |
|---|---|---|
baseImagePath |
The path to the base image. | |
overlayImagePath |
The path to the overlay image. | |
outputImage |
The path for the output image. | |
offset |
The offset (in pixels) where the overlay is applied. | |
compositeOperator |
The composite operator to use for combining the images. |
Divooka.DSL.ImageProcessing.OneShotProcessing.CompositeImages()
Composites an overlay image onto a base image using the specified composite operator and offset.
Parameters
| Name | Description | Default |
|---|---|---|
baseImage |
The base image as a Divooka.Multimedia.Image.PixelImage. | |
overlayImage |
The overlay image as a Divooka.Multimedia.Image.PixelImage. | |
offset |
The offset (in pixels) where the overlay is applied. | |
compositeOperator |
How to combine the overlay with the base image. |
Returns
A new Divooka.Multimedia.Image.PixelImage with the overlay composited.
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustColorBalance()
Adjusts the color balance of the image by adding offsets to the red, green, and blue channels.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
outputImage |
Path for the output image. | |
redOffset |
The offset to add to the red channel (negative or positive, in the Q8 range 0-255). | |
greenOffset |
The offset to add to the green channel. | |
blueOffset |
The offset to add to the blue channel. |
Divooka.DSL.ImageProcessing.OneShotProcessing.AdjustColorBalance()
Adjusts the color balance of the image by adding offsets to the red, green, and blue channels.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. | |
redOffset |
Offset to add to the red channel (can be negative or positive in 0-255 range). | |
greenOffset |
Offset to add to the green channel. | |
blueOffset |
Offset to add to the blue channel. |
Returns
A new Divooka.Multimedia.Image.PixelImage with adjusted color balance.
Divooka.DSL.ImageProcessing.OneShotProcessing.InvertColors()
Inverts the colors of the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
Path to the original image. | |
outputImage |
Path for the output image. |
Divooka.DSL.ImageProcessing.OneShotProcessing.InvertColors()
Inverts the colors of the image.
Parameters
| Name | Description | Default |
|---|---|---|
originalImage |
The source Divooka.Multimedia.Image.PixelImage. |
Returns
A new Divooka.Multimedia.Image.PixelImage with inverted colors.
Divooka.DSL.ImageProcessing.OneShotProcessing.ConvertToIco()
Converts the given iamge file to an ICO file.
Parameters
| Name | Description | Default |
|---|---|---|
pngPath |
The source image. | |
icoPath |
The path for the output .ico file. | |
multipleResolution |
If true, creates multiple icon resolutions; otherwise a single resolution. |
Divooka.DSL.ImageProcessing.OneShotProcessing.ConvertToIco()
Converts the given Divooka.Multimedia.Image.PixelImage to an ICO file.
Parameters
| Name | Description | Default |
|---|---|---|
image |
The source Divooka.Multimedia.Image.PixelImage. | |
icoPath |
The path for the output .ico file. | |
multipleResolution |
If true, creates multiple icon resolutions; otherwise a single resolution. |
Divooka.DSL.ImageProcessing.Utilities.ParcelFrontendImagePreviewSupport.PreviewImage()
Enable previewing using hard-coded protocol; In the future this will not be necessary when we have better context hints (e.g. through Package metadata)
Divooka.DSL.ImageProcessing.Utilities.PNG2ICO
Converts PNG to ICO
Remarks
Also see https://github.com/chaojian-zhang/Png2Ico for an implementation based on System.Drawing.Common
Divooka.DSL.ImageProcessing.Utilities.PNG2ICO.QuickEmbed()
Embeds the png into ico.
Remarks
The ICO file format consists of a header, one or more directory entries (one per image), and then the image data. For modern Windows (Vista and later), you can embed the original PNG data directly into the ICO file by writing the proper header and directory entry before the PNG bytes.
Parameters
| Name | Description | Default |
|---|---|---|
pngFilePath |
Input png | |
icoFilePath |
Output ico |
Divooka.DSL.ImageProcessing.Utilities.PNG2ICO.ConvertPngToIco()
Convert using SkiaSharp.
Parameters
| Name | Description | Default |
|---|---|---|
pngPath |
Source path. | |
icoPath |
Output path. |
Divooka.DSL.ImageProcessing.Utilities.PNG2ICO.ConvertPngToIco()
Convert PNG to ico with multiple sizes.
Remarks
Implemented using ImageMagick.
Divooka.DSL.ImageProcessing.Utilities.MagickHelper.ToPixelImageFast()
Remarks
This is at least 5x faster than the version above.
Divooka.DSL.ImageProcessing.Utilities.Stiching
Stiches images together for comparison purpose.
Remarks
Per https://github.com/Pure-the-Language/CentralSnippets/blob/main/Snippets/ImageProcessing/StitchImages.cs
Divooka.DSL.ImageProcessing.Utilities.Stiching.StichImages()
Stich from files, taking image names as labels