agentleFS
aspose-imagingaspose-imaging/agentic-net-examples/image-and-photo-filters/agents.md

agentic-net-examples / image-and-photo-filters

AGENTS.md1 starsChanged 7 months agoMITView on GitHub

C# examples for Image and Photo Filters using Aspose.Imaging for .NET

The file

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

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test mask inversion correctness with unit tests

    line 130
  2. Distinctive:

    Remove watermarks from PNG images using an ellipse mask and Telea inpainting

    line 136
  3. Distinctive:

    When you need to verify that an ImageGrayscaleMask correctly flips white and black masks, you can run the unit‑test example that loads a …

    line 162
  4. Very specific:

    If you have an animated APNG and must apply a filter to each frame of an APNG image, the sample that iterates through ApngImage.Frames lets …

    line 163
  5. Distinctive:

    When adjusting brightness or contrast across an animation, the gamma adjustment on APNG frames using Aspose.Imaging demo shows how to apply …

    line 165
  6. Distinctive:

    If you need to change the format of an APNG after filtering, the Convert Apng category provides examples for converting APNGs to other …

    line 169
  7. Distinctive:

    When your filter work involves more complex convolution kernels, the Kernel Filters section shows how to combine custom kernels with the …

    line 170
  8. Distinctive:

    Use the ImageGrayscaleMask class, call its Invert() method on a white or black mask, and assert the resulting pixel values in your test.

    line 198
  9. Very specific:

    Create a MagicWand object, set the target color and tolerance, generate an ImageMask, and apply the filter to isolate that region.

    line 204

≈ “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 - Image and Photo Filters

Persona

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

Required Namespaces

  • using System; (72/148 files)
  • using System.IO; (72/148 files)
  • using Aspose.Imaging; (72/148 files) ← category-specific
  • using Aspose.Imaging.ImageOptions; (55/148 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Png; (35/148 files) ← category-specific
  • using Aspose.Imaging.MagicWand; (33/148 files) ← category-specific
  • using Aspose.Imaging.MagicWand.ImageMasks; (31/148 files) ← category-specific
  • using Aspose.Imaging.Shapes; (20/148 files) ← category-specific
  • using Aspose.Imaging.Sources; (18/148 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Tiff; (8/148 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Jpeg; (7/148 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Tiff.Enums; (6/148 files) ← category-specific
  • using Aspose.Imaging.Watermark; (6/148 files) ← category-specific
  • using Aspose.Imaging.Watermark.Options; (6/148 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Gif; (4/148 files) ← category-specific
  • using Aspose.Imaging.Masking; (4/148 files) ← category-specific
  • using Aspose.Imaging.Masking.Options; (4/148 files) ← category-specific
  • using Aspose.Imaging.Masking.Result; (4/148 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Bmp; (3/148 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Gif.Blocks; (2/148 files) ← category-specific
  • using Aspose.Imaging.Brushes; (2/148 files) ← category-specific
  • using System.Collections.Generic; (2/148 files)
  • using Aspose.Imaging.FileFormats.Webp; (1/148 files) ← category-specific
  • using System.Text; (1/148 files)
  • using System.Diagnostics; (1/148 files)
  • using System.Linq; (1/148 files)

Files in this folder

FileKey APIsDescription
load-a-jpeg-image-apply-alpha-blending-with-127-opacity-and-save-as-png.csJpegImage, PngOptions, RasterImageLoad a JPEG image, apply alpha blending with 127 opacity, and save as PNG.
calculate-center-coordinates-of-a-bmp-background-blend-a-png-overlay-and-export-to-tiff.csRasterImage, TiffOptionsCalculate center coordinates of a BMP background, blend a PNG overlay, and expor...
batch-process-a-folder-of-png-images-applying-64-alpha-overlay-and-saving-results-as-jpeg-files.csGraphics, JpegOptions, PngImageBatch process a folder of PNG images, applying 64‑alpha overlay and saving resul...
create-a-point-object-at-100-200-to-position-overlay-on-a-tiff-image.csGraphics, TiffImageCreate a Point object at (100,200) to position overlay on a TIFF image.
define-a-custom-overlay-rectangle-of-200x150-pixels-and-blend-it-onto-a-gif-background.csGifImage, GifOptions, GraphicsDefine a custom overlay rectangle of 200x150 pixels and blend it onto a GIF back...
apply-alpha-blending-with-full-opacity-255-to-a-png-overlay-and-verify-no-transparency-loss.csPngOptions, RasterImageApply alpha blending with full opacity (255) to a PNG overlay and verify no tran...
use-magic-wand-tool-with-threshold-30-to-select-red-region-in-a-jpeg-image.csJpegOptions, RasterImageUse Magic Wand tool with threshold 30 to select red region in a JPEG image.
combine-two-magic-wand-selections-using-union-operation-and-save-the-combined-mask-as-png.csPngOptions, RasterImageCombine two Magic Wand selections using union operation and save the combined ma...
subtract-a-green-magic-wand-selection-from-a-blue-selection-and-export-the-result-to-bmp.csBmpOptions, RasterImageSubtract a green Magic Wand selection from a blue selection and export the resul...
invert-a-magic-wand-selection-on-a-tiff-image-and-fill-the-inverted-area-with-white.csRasterImage, TiffOptionsInvert a Magic Wand selection on a TIFF image and fill the inverted area with wh...
apply-feathering-of-radius-5-pixels-to-a-magic-wand-selection-before-saving-as-png.csPngOptions, RasterImageApply feathering of radius 5 pixels to a Magic Wand selection before saving as P...
remove-watermark-from-a-jpeg-using-content-aware-fill-algorithm-with-three-removal-attempts.csJpegImageRemove watermark from a JPEG using content‑aware fill algorithm with three remov...
remove-watermark-from-a-png-using-telea-algorithm-and-set-removal-attempts-to-five.csPngImage, TeleaWatermarkOptionsRemove watermark from a PNG using Telea algorithm and set removal attempts to fi...
define-watermark-region-coordinates-50-50-200-100-and-apply-removal-filter-on-a-bmp-image.csBmpOptions, RasterImageDefine watermark region coordinates (50,50,200,100) and apply removal filter on ...
batch-remove-watermarks-from-a-folder-of-tiff-files-using-content-aware-fill-and-save-results.csTiffImageBatch remove watermarks from a folder of TIFF files using content‑aware fill and...
load-an-image-from-a-memory-stream-apply-alpha-blending-and-write-output-to-another-stream.csPngOptions, RasterImageLoad an image from a memory stream, apply alpha blending, and write output to an...
resize-a-jpeg-to-800x600-before-applying-magic-wand-selection-with-threshold-40.csRasterImageResize a JPEG to 800x600 before applying Magic Wand selection with threshold 40.
rotate-a-png-by-90-degrees-then-blend-a-semi-transparent-overlay-and-save-as-gif.csGifOptions, Graphics, PngOptionsRotate a PNG by 90 degrees, then blend a semi‑transparent overlay and save as GI...
crop-a-bmp-to-central-400x400-area-apply-feathered-magic-wand-selection-and-export-to-png.csPngOptions, RasterImageCrop a BMP to central 400x400 area, apply feathered Magic Wand selection, and ex...
process-each-page-of-a-multi-page-tiff-applying-alpha-blending-with-200-opacity-and-save.csRasterImage, TiffImageProcess each page of a multi‑page TIFF, applying alpha blending with 200 opacity...
convert-a-pdf-page-to-image-apply-watermark-removal-and-save-the-cleaned-image-as-jpeg.csJpegOptions, RasterImage, VectorRasterizationOptionsConvert a PDF page to image, apply watermark removal, and save the cleaned image...
load-a-gif-animation-apply-magic-wand-selection-on-first-frame-and-reassemble-animation.csGifImage, GifOptions, RasterImageLoad a GIF animation, apply Magic Wand selection on first frame, and reassemble ...
apply-alpha-blending-with-0-opacity-to-verify-that-background-image-remains-unchanged-after-operation.csPngOptions, RasterImageApply alpha blending with 0 opacity to verify that background image remains unch...
set-overlay-alpha-to-192-and-blend-a-png-logo-onto-a-jpeg-banner-at-bottom-right-corner.csJpegOptions, RasterImageSet overlay alpha to 192 and blend a PNG logo onto a JPEG banner at bottom‑right...
use-magic-wand-threshold-70-to-select-sky-region-in-a-landscape-png-and-invert-selection.csPngOptions, RasterImageUse Magic Wand threshold 70 to select sky region in a landscape PNG and invert s...
combine-three-magic-wand-selections-using-union-then-apply-feathering-of-radius-8-before-saving.csRasterImageCombine three Magic Wand selections using union, then apply feathering of radius...
subtract-a-text-watermark-selection-from-a-scanned-document-image-and-export-as-high-resolution-tiff.csRasterImage, TiffOptionsSubtract a text watermark selection from a scanned document image and export as ...
apply-content-aware-fill-removal-on-a-jpeg-with-two-attempts-then-compare-result-with-telea-algorithm.csContentAwareFillWatermarkOptions, JpegImage, TeleaWatermarkOptionsApply content‑aware fill removal on a JPEG with two attempts, then compare resul...
load-images-from-a-zip-archive-apply-alpha-blending-to-each-and-write-outputs-to-another-zip.csBmpOptions, GifOptions, JpegOptionsLoad images from a ZIP archive, apply alpha blending to each, and write outputs ...
create-a-custom-selection-by-combining-magic-wand-union-and-subtraction-then-fill-with-solid-color.csGraphics, PngOptions, RasterImageCreate a custom selection by combining Magic Wand union and subtraction, then fi...
...and 118 more filesView all

Category Statistics

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

Key API Surface

  • ApngFrame
  • ApngImage
  • ApngOptions
  • AutoMaskingGraphCutOptions
  • BigTiffImage
  • BilateralSmoothingFilterOptions
  • BmpImage
  • BmpOptions
  • ContentAwareFillWatermarkOptions
  • GaussWienerFilterOptions
  • GaussianBlurFilterOptions
  • GifImage
  • GifOptions
  • GraphCutMaskingOptions
  • Graphics
  • ImageBlendingFilterOptions
  • JpegImage
  • JpegOptions
  • MaskingOptions
  • MedianFilterOptions
  • MotionWienerFilterOptions
  • PngImage
  • PngOptions
  • RasterCachedImage
  • RasterImage
  • SharpenFilterOptions
  • SolidBrush
  • TeleaWatermarkOptions
  • TiffImage
  • TiffOptions
  • VectorRasterizationOptions

Failed Tasks

All tasks passed ✅

Operations Covered

  • Invert grayscale mask for white and black masks
  • Test mask inversion correctness with unit tests
  • Apply a filter to each frame of an APNG image
  • Preserve animation properties while filtering APNG frames
  • Adjust gamma of APNG frames (pixel‑data modification)
  • Apply Magic Wand filter to a raster image (JPEG/PNG)
  • Apply Magic Wand filter to an APNG image (pixel‑data modification)
  • Remove watermarks from PNG images using an ellipse mask and Telea inpainting
  • Combine two Magic Wand selections using a union operation
  • Save a combined mask as a PNG file

Supported Formats

  • PNG – used for input images, output masks, and APNG frames.
  • JPEG – loaded as a raster image before applying the Magic Wand filter.
  • APNG – animated PNG format; loaded, filtered frame‑by‑frame, and saved.

API Classes Used

  • Image — base class for loading any supported image format.
  • RasterImage — represents a raster (single‑frame) image that allows direct pixel access.
  • ApngImage — specialized class for handling animated PNG files and their frames.
  • PngOptions — provides options for saving images in PNG format (e.g., compression).
  • MagicWand — performs color‑based selection to create masks based on similarity criteria.
  • ImageMask (in Aspose.Imaging.MagicWand.ImageMasks) — stores the mask generated by Magic Wand operations.
  • Watermark — contains methods for removing watermarks from images.
  • WatermarkOptions — configures watermark removal, including mask shape and inpainting algorithm.
  • EllipseShape (from Aspose.Imaging.Shapes) — defines an elliptical region used as a mask for watermark removal.
  • Image.Load(string) — static method that loads an image file into an appropriate Image‑derived object.
  • Image.Save(string, ImageOptions) — saves the processed image using specified format options.
  • Directory.CreateDirectory(string) — ensures the output folder exists before saving files.
  • File.Exists(string) — checks for the presence of the input file before processing.

Use Cases

  • When you need to verify that an ImageGrayscaleMask correctly flips white and black masks, you can run the unit‑test example that loads a PNG, applies the mask inversion, and checks both fully‑white and fully‑black inputs.
  • If you have an animated APNG and must apply a filter to each frame of an APNG image, the sample that iterates through ApngImage.Frames lets you modify pixel data while keeping the original frame order.
  • To keep the original timing, loop count, and disposal methods while adding a visual effect, use the example that preserves animation properties while applying an image filter to APNG and then saves the result back to an APNG file.
  • When adjusting brightness or contrast across an animation, the gamma adjustment on APNG frames using Aspose.Imaging demo shows how to apply a gamma correction to every frame without breaking the animation sequence.
  • For selective region editing, the use MagicWand filter to process a specified image in C# snippet demonstrates loading a raster image, creating a wand selection, and applying the mask to produce a cleaned‑up PNG output.

Related Categories

If you need to change the format of an APNG after filtering, the Convert Apng category provides examples for converting APNGs to other raster formats.
When your filter work involves more complex convolution kernels, the Kernel Filters section shows how to combine custom kernels with the same image loading techniques used here.
For broader image manipulation tasks—such as resizing, rotating, or compositing multiple frames—see the Manipulating Images category, which builds on the same Aspose.Imaging APIs demonstrated in these filter examples.

Get Started

Ready to try Image And Photo 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_054922 | Examples: 148

<!-- AUTOGENERATED:END -->

Developer Q&A

Q: How can I unit‑test ImageGrayscaleMask inversion for both fully white and fully black masks in C# with Aspose.Imaging?

Use the ImageGrayscaleMask class, call its Invert() method on a white or black mask, and assert the resulting pixel values in your test. → See: add-unit-tests-that-verify-mask-inversion-works-correctly-for-both-fully-white-and-fully-black-initial-masks.cs

Q: How do I apply an image filter to every raster frame of an APNG while keeping the animation intact using Aspose.Imaging in .NET?

Load the file with ApngImage, loop through its RasterFrames, apply the desired filter via ImageOptions to each frame, then save the image. → See: apply-a-specified-image-filter-to-each-raster-frame-within-an-apng-image-while-maintaining-animation-integrity.cs

Q: How can I isolate a specific color region with the Magic Wand filter in Aspose.Imaging for C#?

Create a MagicWand object, set the target color and tolerance, generate an ImageMask, and apply the filter to isolate that region. → See: apply-image-and-photo-filters-to-isolate-a-specific-color-region-using-the-magic-wand-selection-tool.cs

Q: How do I center a PNG overlay on a BMP background and export the result as a TIFF using Aspose.Imaging in C#?

Load the BMP and PNG with Image.Load, calculate the center coordinates, draw the PNG onto the BMP via Graphics.DrawImage, and save with TiffOptions. → See: calculate-center-coordinates-of-a-bmp-background-blend-a-png-overlay-and-export-to-tiff.cs

Q: How can I configure the RemoveWatermark filter with a specific watermark color and threshold in Aspose.Imaging for .NET?

Instantiate WatermarkRemover, set its WatermarkColor and Threshold properties, then call Apply() to remove the watermark. → See: configure-the-remove-watermark-filter-by-defining-watermark-color-and-appropriate-threshold-parameters-clearly.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.