agentleFS
aspose-imagingaspose-imaging/agentic-net-examples/kernel-filters/agents.md

agentic-net-examples / kernel-filters

AGENTS.md1 starsChanged 7 months agoMITView on GitHub

C# examples for Kernel Filters using Aspose.Imaging for .NET

The file

We split this agents.md into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If you’re looking to combine blur or sharpening with color adjustments, the Image And Photo Filters examples demonstrate how to chain …

    line 178
  2. Very specific:

    Use ConvolutionFilter with your custom kernel matrix in a FilterOptions object and call image.ApplyFilter.

    line 206

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
agents.md

AGENTS - Kernel Filters

Persona

You are a C# developer specializing in image processing using Aspose.Imaging for .NET, working within the Kernel Filters category. This folder contains standalone C# examples for Kernel Filters operations. See the root agents.md for repository-wide conventions and boundaries.

Required Namespaces

  • using System; (231/465 files)
  • using System.IO; (231/465 files)
  • using Aspose.Imaging; (228/465 files) ← category-specific
  • using Aspose.Imaging.ImageOptions; (161/465 files) ← category-specific
  • using Aspose.Imaging.ImageFilters.FilterOptions; (134/465 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Png; (52/465 files) ← category-specific
  • using Aspose.Imaging.ImageFilters.Convolution; (42/465 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Svg; (28/465 files) ← category-specific
  • using Aspose.Imaging.Sources; (18/465 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Tiff; (8/465 files) ← category-specific
  • using System.Collections.Generic; (8/465 files)
  • using System.Drawing; (6/465 files)
  • using Aspose.Imaging.FileFormats.Tiff.Enums; (4/465 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Jpeg; (4/465 files) ← category-specific
  • using System.Linq; (4/465 files)
  • using Aspose.Imaging.CoreExceptions; (3/465 files) ← category-specific
  • using System.Threading.Tasks; (3/465 files)
  • using System.Diagnostics; (2/465 files)
  • using System.Threading; (2/465 files)
  • using System.Text.Json; (2/465 files)
  • using Aspose.Imaging.FileFormats.Apng; (2/465 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Bmp; (1/465 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Svg.Graphics; (1/465 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Webp; (1/465 files) ← category-specific
  • using Aspose.Imaging.CoreExceptions.ImageFormats; (1/465 files) ← category-specific
  • using Aspose.Imaging.Multithreading; (1/465 files) ← category-specific
  • using System.Net.Http; (1/465 files)
  • using System.Xml; (1/465 files)
  • using System.Xml.Schema; (1/465 files)
  • using Aspose.Imaging.FileFormats; (1/465 files) ← category-specific
  • using Aspose.Imaging.Brushes; (1/465 files) ← category-specific

Files in this folder

FileKey APIsDescription
load-a-png-image-from-the-templates-folder-and-apply-a-predefined-5x5-blur-box-filter.csGaussianBlurFilterOptions, RasterImageLoad a PNG image from the templates folder and apply a predefined 5x5 blur box f...
create-a-custom-3x3-convolution-matrix-and-apply-it-to-a-jpeg-image-loaded-from-disk.csJpegOptions, RasterImageCreate a custom 3x3 convolution matrix and apply it to a JPEG image loaded from ...
validate-that-a-custom-7x7-kernel-has-odd-dimensions-before-applying-it-to-a-png-file.csValidate that a custom 7x7 kernel has odd dimensions before applying it to a PNG...
normalize-a-custom-kernel-so-its-coefficients-sum-to-one-and-apply-to-a-jpeg-image.csJpegOptions, RasterImageNormalize a custom kernel so its coefficients sum to one and apply to a JPEG ima...
adjust-kernel-coefficients-to-increase-brightness-while-applying-a-5x5-blur-to-a-bmp-image.csBmpOptions, RasterImageAdjust kernel coefficients to increase brightness while applying a 5x5 blur to a...
apply-a-zero-sum-edge-detection-kernel-to-a-png-image-and-verify-black-background-with-highlighted-edges.csPngOptions, RasterImageApply a zero‑sum edge detection kernel to a PNG image and verify black backgroun...
generate-an-emboss-effect-using-a-3x3-kernel-on-a-jpeg-image-and-export-to-tiff-format.csConvolutionFilterOptions, RasterImage, TiffOptionsGenerate an emboss effect using a 3x3 kernel on a JPEG image and export to TIFF ...
use-a-custom-5x5-kernel-to-compute-average-pixel-values-and-apply-as-a-smoothing-filter-on-png.csPngOptions, RasterImageUse a custom 5x5 kernel to compute average pixel values and apply as a smoothing...
apply-a-gaussian-blur-filter-with-sigma-1-5-to-a-bmp-image-and-save-as-png.csGaussianBlurFilterOptions, RasterImageApply a Gaussian blur filter with sigma 1.5 to a BMP image and save as PNG.
apply-a-motion-blur-filter-with-a-45-degree-angle-on-a-tiff-image-and-export-to-jpeg.csJpegOptions, MotionWienerFilterOptions, TiffImageApply a motion blur filter with a 45 degree angle on a TIFF image and export to ...
apply-a-motion-blur-filter-with-length-10-pixels-to-a-bmp-image-and-save-as-jpeg.csJpegOptions, MotionWienerFilterOptions, RasterImageApply a motion blur filter with length 10 pixels to a BMP image and save as JPEG...
apply-a-motion-blur-filter-with-horizontal-direction-to-a-tiff-image-and-export-to-png.csMotionWienerFilterOptions, PngOptions, TiffImageApply a motion blur filter with horizontal direction to a TIFF image and export ...
apply-a-predefined-blur-box-filter-of-size-3x3-to-an-svg-image-and-save-as-png.csConvolutionFilterOptions, PngOptions, RasterImageApply a predefined blur box filter of size 3x3 to an SVG image and save as PNG.
apply-a-predefined-blur-box-filter-to-all-png-files-in-a-folder-and-output-jpegs.csGaussianBlurFilterOptions, JpegOptions, RasterImageApply a predefined blur box filter to all PNG files in a folder and output JPEGs...
adjust-the-size-of-a-blur-box-kernel-from-3x3-to-7x7-to-increase-smoothing-on-bmp-file.csBmpOptions, RasterImageAdjust the size of a blur box kernel from 3x3 to 7x7 to increase smoothing on BM...
normalize-a-blur-kernel-so-its-total-sum-equals-one-and-apply-to-a-bmp-image-for-uniform-blur.csBmpOptions, ConvolutionFilterOptions, RasterImageNormalize a blur kernel so its total sum equals one and apply to a BMP image for...
normalize-a-custom-7x7-kernel-for-neutral-brightness-and-apply-to-a-jpeg-image-for-soft-focus.csGaussianBlurFilterOptions, JpegImage, RasterImageNormalize a custom 7x7 kernel for neutral brightness and apply to a JPEG image f...
normalize-a-3x3-sharpening-kernel-to-preserve-overall-image-brightness-before-applying-to-jpeg.csJpegOptions, RasterImageNormalize a 3x3 sharpening kernel to preserve overall image brightness before ap...
create-a-deconvolution-filter-to-restore-a-previously-blurred-jpeg-image-and-save-as-png.csGaussWienerFilterOptions, PngOptions, RasterImageCreate a deconvolution filter to restore a previously blurred JPEG image and sav...
use-the-deconvolution-filter-to-reverse-a-motion-blur-effect-on-a-png-image-and-save-as-tiff.csMotionWienerFilterOptions, RasterImage, TiffOptionsUse the deconvolution filter to reverse a motion blur effect on a PNG image and ...
validate-that-the-sum-of-coefficients-in-a-custom-kernel-equals-one-to-avoid-brightness-shift.csPngOptions, RasterImageValidate that the sum of coefficients in a custom kernel equals one to avoid bri...
validate-that-a-custom-kernel-s-dimensions-are-odd-before-applying-a-deconvolution-filter-to-png.csPngOptions, RasterImageValidate that a custom kernel's dimensions are odd before applying a deconvoluti...
validate-that-a-custom-sharpening-kernel-s-sum-exceeds-one-to-achieve-brightness-increase-on-png-image.csConvolutionFilterOptions, PngOptions, RasterImageValidate that a custom sharpening kernel's sum exceeds one to achieve brightness...
chain-a-sharpen-filter-followed-by-an-emboss-filter-on-a-svg-image-and-save-as-bmp.csBmpOptions, ConvolutionFilterOptions, PngOptionsChain a sharpen filter followed by an emboss filter on a SVG image and save as B...
chain-a-gaussian-blur-filter-followed-by-a-sharpen-filter-on-a-tiff-image-and-export-to-png.csGaussianBlurFilterOptions, PngOptions, SharpenFilterOptionsChain a Gaussian blur filter followed by a sharpen filter on a TIFF image and ex...
chain-three-filters-blur-edge-detection-and-sharpen-on-a-png-image-and-save-as-jpeg.csGaussianBlurFilterOptions, JpegOptions, RasterImageChain three filters: blur, edge detection, and sharpen on a PNG image and save a...
chain-a-blur-box-filter-then-an-emboss-filter-then-a-sharpen-filter-on-a-jpeg-image-for-complex-styling.csConvolutionFilterOptions, JpegOptions, RasterImageChain a blur box filter, then an emboss filter, then a sharpen filter on a JPEG ...
batch-process-a-collection-of-bmp-images-with-a-custom-edge-detection-kernel-and-output-jpegs.csConvolutionFilterOptions, JpegOptions, RasterImageBatch process a collection of BMP images with a custom edge detection kernel and...
batch-apply-a-predefined-blur-box-filter-to-all-png-files-in-a-folder-and-output-jpegs.csGaussianBlurFilterOptions, JpegOptions, RasterImageBatch apply a predefined blur box filter to all PNG files in a folder and output...
batch-apply-a-sharpen-filter-to-all-png-files-in-a-directory-and-overwrite-originals-safely.csRasterImage, SharpenFilterOptionsBatch apply a sharpen filter to all PNG files in a directory and overwrite origi...
...and 435 more filesView all

Category Statistics

  • Total examples: 465
  • Failed: 0
  • Pass rate: 100.0%

Key API Surface

  • ApngFrame
  • ApngImage
  • ApngOptions
  • BilateralSmoothingFilterOptions
  • BmpOptions
  • ConvolutionFilter
  • ConvolutionFilterOptions
  • DeconvolutionFilterOptions
  • EdgeDetectionFilterOptions
  • GaussWienerFilterOptions
  • GaussianBlurFilterOptions
  • Graphics
  • Image
  • JpegImage
  • JpegOptions
  • JsonSerializerOptions
  • LazyImage
  • LoadOptions
  • MedianFilterOptions
  • MotionWienerFilter
  • MotionWienerFilterOptions
  • MultiPageOptions
  • ParallelOptions
  • PdfOptions
  • PngImage
  • PngOptions
  • RasterImage
  • SharpenFilterOptions
  • SolidBrush
  • SvgImage
  • SvgOptions
  • SvgRasterizationOptions
  • TiffImage
  • TiffOptions
  • VectorRasterizationOptions
  • VignetteFilter
  • WebPImage
  • WebPOptions

Failed Tasks

All tasks passed ✅

Operations Covered

  • Rasterize SVG to PNG
  • Apply Gaussian blur filter
  • Apply Deconvolution filter to PSD
  • Apply Motion blur effect to OTG
  • Apply Sharpen filter via convolution
  • Apply Edge detection filter to BMP
  • Convert ICO image to PNG
  • Save processed image to file

Supported Formats

  • SVG – input image that is rasterized to PNG
  • PNG – used for output (and intermediate) files
  • ICO – input icon file that is processed and saved as PNG
  • PSD – input and output Photoshop document
  • TIFF – input and output raster image
  • OTG – input OpenType graphics file, processed and saved as PNG
  • BMP – input and output bitmap image

API Classes Used

  • Image — core class that loads images with Image.Load and writes them with Save.
  • RasterImage — subclass of Image that enables raster‑based operations such as applying filters.
  • ImageOptions — base class for format‑specific save options (used when saving processed images).
  • File — provides Exists to verify that a source file is present.
  • Directory — provides CreateDirectory to ensure output folders exist.
  • Path — supplies utilities for handling file‑path strings (e.g., GetDirectoryName).
  • Console — used to write error messages to the console.

Use Cases

  • When you need to rasterize an SVG to PNG and then apply a Gaussian blur in a .NET service, the “Rasterize SVG To PNG And Apply Gaussian Blur In C#” example shows the exact sequence of loading the SVG, converting it to a raster image, applying GaussianBlurFilterOptions, and saving the result.
  • If your application must blur an ICO image and output it as a PNG, the “Apply a Blur Filter to an ICO Image and Write the Processed Output to a New File” snippet demonstrates loading the ICO, casting to RasterImage, applying a Gaussian blur kernel, and writing the PNG with PngOptions.
  • For restoring detail in a blurred Photoshop file, the deconvolution filter on a PSD image using Aspose.Imaging example illustrates how to load a PSD, cast to RasterImage, apply DeconvolutionFilterOptions, and save the corrected file.
  • When preprocessing a multi‑page TIFF for OCR, the “Apply a Gaussian Blur Filter to a TIFF Image and Save the Resulting File” code provides a ready‑to‑use pattern for loading a TIFF, applying GaussianBlurFilterOptions via the kernel filter API, and persisting the blurred image.
  • To add a motion‑blur effect to an OTG graphic before converting it to PNG, the “Apply a Motion Blur Effect to an OTG Image and Persist the Processed Output to a File” sample shows how to use MotionBlurFilterOptions as a kernel filter and then save the transformed image with PngOptions.

Related Categories

Kernel Filters often complement format‑conversion tasks, so you’ll find the Convert SVG To Raster Images category useful when you need to handle SVG inputs before applying any kernel‑based processing.
If you’re looking to combine blur or sharpening with color adjustments, the Image And Photo Filters examples demonstrate how to chain multiple filter types together.
For broader image manipulation workflows—such as resizing, cropping, or format changes after a kernel filter—check out the Manipulating Images category, which provides a comprehensive set of operations that work seamlessly with the kernel filter examples shown here.

Get Started

Ready to try Kernel Filters conversions on your own files with Aspose.Imaging for .NET?

dotnet add package Aspose.Imaging
ResourceLink
📖 Documentationdocs.aspose.com/imaging/net
📦 NuGet Packagewww.nuget.org/packages/aspose.imaging
🚀 Release Notesreleases.aspose.com/imaging/net
🌐 Online Appsproducts.aspose.app/imaging/family
🔑 Free Temporary Licensepurchase.aspose.com/temporary-license
🤝 Consulting (paid implementation help)consulting.aspose.com
<!-- AUTOGENERATED:START -->

Updated: 2026-09-16 | Run: 20260722_085233 | Examples: 465

<!-- AUTOGENERATED:END -->

Developer Q&A

Q: How can I apply a custom 3x3 convolution kernel to a PNG image with Aspose.Imaging for .NET?

Use ConvolutionFilter with your custom kernel matrix in a FilterOptions object and call image.ApplyFilter. → See: apply-a-convolution-kernel-filter-to-an-image-using-custom-matrix-coefficients-to-achieve-the-specified-transformation.cs

Q: What is the proper way to catch and log an invalid kernel exception when applying a convolution filter to an SVG using Aspose.Imaging in C#?

Wrap the filter call in a try‑catch block for ConvolutionFilterException and log the exception details. → See: catch-and-log-convolutionfilter-exceptions-when-applying-an-invalid-custom-kernel-to-an-svg-image.cs

Q: How do I normalize a Gaussian blur kernel to keep the original image brightness when using Aspose.Imaging for .NET?

Set the Normalize property of GaussianBlurFilter to true (or divide each kernel coefficient by the sum of all coefficients) before applying the filter. → See: document-best-practices-for-kernel-normalization-to-maintain-consistent-image-brightness-across-filters.cs

Q: How can I deconvolve an SVG image and save the result as a PNG using Aspose.Imaging in C#?

Load the SVG with Image.Load, apply a DeconvolutionFilter via image.ApplyFilter, then save the result with PngOptions. → See: apply-a-deconvolution-filter-to-an-svg-image-and-store-the-processed-output-as-a-new-file.cs

Q: How to programmatically create a 3x3 edge‑detection kernel at runtime and apply it to a PNG image with Aspose.Imaging for .NET?

Construct a 3x3 float array for the edge kernel, instantiate a ConvolutionFilter with that array, and apply it to the loaded PNG image. → See: programmatically-generate-a-3x3-edge-detection-kernel-at-runtime-and-apply-it-to-a-png-image.cs

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.