API Reference
OfficeRasterFilters
Bounded, dependency-free operations that return a separately owned raster without modifying the source.
Inheritance
- Object
- OfficeRasterFilters
Remarks
Color operations preserve straight alpha unless explicitly changing opacity or applying a color matrix. Neighborhood operations use premultiplied alpha so invisible RGB values do not bleed into visible pixels.
Methods
public static OfficeRasterImage AdaptiveThreshold(OfficeRasterImage source, Int32 radius = 15, Double contrast = 0.15, CancellationToken cancellationToken = default) #OfficeRasterImageApplies an alpha-weighted local-mean threshold using a pixel radius and relative contrast between zero and one.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- radius System.Int32 = 15
- contrast System.Double = 0.15
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage BokehBlur(OfficeRasterImage source, Int32 radius = 5, Double gamma = 3, CancellationToken cancellationToken = default) #OfficeRasterImageApplies a circular aperture blur in a gamma-adjusted channel space; radius is in pixels.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- radius System.Int32 = 5
- gamma System.Double = 3
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage BoxBlur(OfficeRasterImage source, Int32 radius = 7, CancellationToken cancellationToken = default) #OfficeRasterImageApplies a square box blur with a radius in pixels and premultiplied-alpha sampling.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- radius System.Int32 = 7
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Brightness(OfficeRasterImage source, Double amount = 1, CancellationToken cancellationToken = default) #OfficeRasterImageMultiplies encoded RGB brightness; one leaves the color unchanged.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- amount System.Double = 1
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage ColorMatrix(OfficeRasterImage source, OfficeRasterColorMatrix matrix, CancellationToken cancellationToken = default) #OfficeRasterImageApplies a caller-owned normalized RGBA affine matrix, including its explicit alpha row.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- matrix OfficeIMO.Drawing.OfficeRasterColorMatrix
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Contrast(OfficeRasterImage source, Double amount = 1, CancellationToken cancellationToken = default) #OfficeRasterImageMultiplies contrast around the encoded-channel midpoint; one is the identity.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- amount System.Double = 1
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Convolve(OfficeRasterImage source, Double[] kernel, Int32 kernelWidth, Int32 kernelHeight, Boolean normalize = true, CancellationToken cancellationToken = default) #OfficeRasterImageApplies an odd-sized row-major convolution kernel with clamped boundary samples and premultiplied alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- kernel System.Double[]
- kernelWidth System.Int32
- kernelHeight System.Int32
- normalize System.Boolean = true
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Dither(OfficeRasterImage source, CancellationToken cancellationToken = default) #OfficeRasterImageProduces ordered black-and-white dithering with a four-by-four Bayer matrix, retaining source alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage GaussianBlur(OfficeRasterImage source, Double sigma = 3, CancellationToken cancellationToken = default) #OfficeRasterImageApplies a normalized Gaussian kernel in premultiplied RGBA space; sigma is measured in pixels.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- sigma System.Double = 3
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage GaussianSharpen(OfficeRasterImage source, Double sigma = 3, CancellationToken cancellationToken = default) #OfficeRasterImageApplies a Gaussian unsharp mask with unit strength while retaining the original alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- sigma System.Double = 3
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Grayscale(OfficeRasterImage source, OfficeRasterGrayscaleMode mode = Bt709, CancellationToken cancellationToken = default) #OfficeRasterImageConverts RGB to the selected encoded-channel luminance while retaining alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- mode OfficeIMO.Drawing.OfficeRasterGrayscaleMode = Bt709
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage HistogramEqualization(OfficeRasterImage source, CancellationToken cancellationToken = default) #OfficeRasterImageApplies alpha-weighted luminance histogram equalization while retaining alpha and approximate RGB hue.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Hue(OfficeRasterImage source, Double degrees, CancellationToken cancellationToken = default) #OfficeRasterImageRotates HSL hue by the supplied number of degrees, retaining lightness and alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- degrees System.Double
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Invert(OfficeRasterImage source, CancellationToken cancellationToken = default) #OfficeRasterImageInverts encoded RGB while retaining alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Kodachrome(OfficeRasterImage source, CancellationToken cancellationToken = default) #OfficeRasterImageApplies a warm, saturated, contrast-enhanced film-style color preset while retaining alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Lightness(OfficeRasterImage source, Double amount = 1, CancellationToken cancellationToken = default) #OfficeRasterImageScales HSL lightness while retaining hue, saturation, and alpha; one is the identity.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- amount System.Double = 1
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Lomograph(OfficeRasterImage source, CancellationToken cancellationToken = default) #OfficeRasterImageApplies a saturated, green-biased film-style preset with dark elliptical edges, retaining alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage OilPaint(OfficeRasterImage source, Int32 levels = 10, Int32 brushSize = 15, CancellationToken cancellationToken = default) #OfficeRasterImageChooses the alpha-weighted dominant luminance bucket in a square brush, retaining each source pixel's alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- levels System.Int32 = 10
- brushSize System.Int32 = 15
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Opacity(OfficeRasterImage source, Double amount = 1, CancellationToken cancellationToken = default) #OfficeRasterImageMultiplies alpha by an amount between zero and one, retaining straight RGB.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- amount System.Double = 1
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Pixelate(OfficeRasterImage source, Int32 size = 4, CancellationToken cancellationToken = default) #OfficeRasterImageReplaces each square block with its premultiplied RGBA average; size is measured in pixels.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- size System.Int32 = 4
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Polaroid(OfficeRasterImage source, CancellationToken cancellationToken = default) #OfficeRasterImageApplies a faded warm instant-film-style preset with gentle edge tint, retaining alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Saturate(OfficeRasterImage source, Double amount = 1, CancellationToken cancellationToken = default) #OfficeRasterImageScales color distance from BT.709 luminance; zero produces grayscale and one is the identity.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- amount System.Double = 1
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Sepia(OfficeRasterImage source, Double amount = 1, CancellationToken cancellationToken = default) #OfficeRasterImageInterpolates between the original color and a warm sepia transform, retaining alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- amount System.Double = 1
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Threshold(OfficeRasterImage source, Double threshold = 0.5, CancellationToken cancellationToken = default) #OfficeRasterImageProduces black or white using a normalized BT.709 threshold, retaining alpha.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- threshold System.Double = 0.5
- cancellationToken System.Threading.CancellationToken = default
public static OfficeRasterImage Vignette(OfficeRasterImage source, Nullable<OfficeColor> color = null, Double amount = 1, CancellationToken cancellationToken = default) #OfficeRasterImageBlends the outer elliptical image region toward a color, retaining source alpha; the center remains unchanged.
Parameters
- source OfficeIMO.Drawing.OfficeRasterImage
- color System.Nullable{OfficeIMO.Drawing.OfficeColor} = null
- amount System.Double = 1
- cancellationToken System.Threading.CancellationToken = default