agentleFS
aspose-imagingaspose-imaging/agentic-net-examples/manipulating-images/agents.md

agentic-net-examples / manipulating-images

AGENTS.md1 starsChanged 7 months agoMITView on GitHub

C# examples for Manipulating Images using Aspose.Imaging for .NET

The file

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

4 rules. About 0 are common, 1 is distinctive, and 3 are 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.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If your workflow requires applying Gaussian blur to multiple CDR files and merging the blurred results into a multipage TIFF, load each …

    line 183
  2. Very specific:

    When you want to use the Bradley threshold algorithm to binarize an image and output the result as an APNG, cast the loaded image to …

    line 185
  3. Distinctive:

    If you need to apply additional visual effects such as sharpening or color adjustments, the Image And Photo Filters category provides a …

    line 190
  4. Very specific:

    Create a FontSettings instance, add each directory via FontSettings.AddFontFolder, assign it to the TIFF image, and save with PdfOptions.

    line 227

≈ “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 - Manipulating Images

Persona

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

Required Namespaces

  • using System; (235/430 files)
  • using System.IO; (235/430 files)
  • using Aspose.Imaging; (230/430 files) ← category-specific
  • using Aspose.Imaging.ImageOptions; (186/430 files) ← category-specific
  • using Aspose.Imaging.Sources; (47/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Tiff; (45/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Png; (43/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Gif; (33/430 files) ← category-specific
  • using Aspose.Imaging.ImageFilters.FilterOptions; (24/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Tiff.Enums; (22/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Cdr; (21/430 files) ← category-specific
  • using Aspose.Imaging.Masking; (17/430 files) ← category-specific
  • using Aspose.Imaging.Masking.Options; (17/430 files) ← category-specific
  • using Aspose.Imaging.Masking.Result; (17/430 files) ← category-specific
  • using System.Collections.Generic; (14/430 files)
  • using Aspose.Imaging.FileFormats.Jpeg; (11/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Bmp; (10/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Gif.Blocks; (10/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Svg; (6/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Pdf; (6/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Psd; (6/430 files) ← category-specific
  • using Aspose.Imaging.Brushes; (5/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Emf; (4/430 files) ← category-specific
  • using System.Diagnostics; (2/430 files)
  • using System.Linq; (2/430 files)
  • using Aspose.Imaging.Shapes; (1/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Emf.Emf.Records; (1/430 files) ← category-specific
  • using Aspose.Imaging.FileFormats.Emf.Emf.Objects; (1/430 files) ← category-specific
  • using Aspose.Imaging.CoreExceptions; (1/430 files) ← category-specific
  • using System.Text; (1/430 files)
  • using Aspose.Imaging.FileFormats.Emf.Graphics; (1/430 files) ← category-specific

Files in this folder

FileKey APIsDescription
load-a-png-image-apply-auto-masking-graph-cut-with-default-strokes-and-save-as-png.csAutoMaskingGraphCutOptions, PngOptions, RasterImageLoad a PNG image, apply auto‑masking Graph Cut with default strokes, and save as...
create-automaskinggraphcutoptions-with-custom-feathering-radius-apply-to-a-png-then-export-result.csAutoMaskingGraphCutOptions, PngOptions, RasterImageCreate AutoMaskingGraphCutOptions with custom feathering radius, apply to a PNG,...
define-a-point-array-for-manual-masking-use-it-on-a-png-and-save-the-processed-image.csPngOptions, RasterImageDefine a Point array for manual masking, use it on a PNG, and save the processed...
reuse-previously-configured-automaskinggraphcutoptions-to-refine-background-removal-on-a-second-png-file.csAutoMaskingGraphCutOptions, PngOptions, RasterImageReuse previously configured AutoMaskingGraphCutOptions to refine background remo...
supply-a-detectedobjectlist-converted-to-assumedobjectdata-for-improved-graph-cut-segmentation-on-a-raster-image.csAutoMaskingGraphCutOptions, PngOptions, RasterImageSupply a DetectedObjectList converted to AssumedObjectData for improved Graph Cu...
load-an-svg-vector-image-remove-its-background-using-default-analysis-and-save-as-png.csPngOptions, SvgImage, SvgRasterizationOptionsLoad an SVG vector image, remove its background using default analysis, and save...
remove-background-from-an-emf-file-by-specifying-a-background-color-that-matches-unwanted-regions.csEmfImage, MetaImageRemove background from an EMF file by specifying a background color that matches...
define-a-rectangular-area-for-selective-background-removal-in-a-cdr-vector-image-before-rasterization.csCdrImage, MaskingOptions, PngOptionsDefine a rectangular area for selective background removal in a CDR vector image...
after-removing-background-from-a-vector-image-rasterize-it-to-png-using-pngoptions-with-default-compression.csPngOptionsAfter removing background from a vector image, rasterize it to PNG using PngOpti...
batch-process-a-folder-of-png-files-applying-auto-masking-graph-cut-with-user-defined-strokes-to-each.csAutoMaskingGraphCutOptions, PngOptions, RasterImageBatch process a folder of PNG files, applying auto‑masking Graph Cut with user‑d...
iterate-over-a-collection-of-svg-files-remove-backgrounds-rasterize-to-png-and-store-results-in-output-directory.csPngOptions, SvgImage, SvgRasterizationOptionsIterate over a collection of SVG files, remove backgrounds, rasterize to PNG, an...
apply-median-filter-to-a-png-image-after-background-removal-to-reduce-residual-noise-before-saving.csMaskingOptions, PngOptions, RasterImageApply median filter to a PNG image after background removal to reduce residual n...
combine-gauss-wiener-deblurring-with-bilateral-smoothing-on-a-raster-image-to-enhance-clarity-after-masking.csAutoMaskingGraphCutOptions, PngOptions, RasterImageCombine Gauss‑Wiener deblurring with bilateral smoothing on a raster image to en...
use-motion-wiener-filter-on-a-png-that-suffered-motion-blur-then-apply-sharpening-for-edge-definition.csMotionWienerFilterOptions, RasterImage, SharpenFilterOptionsUse Motion‑Wiener filter on a PNG that suffered motion blur, then apply sharpeni...
align-horizontal-and-vertical-dpi-of-a-raster-image-before-applying-any-correction-filters-for-consistent-scaling.csAlign horizontal and vertical DPI of a raster image before applying any correcti...
create-bilateralsmoothingfilteroptions-with-size-parameter-set-to-5-apply-to-png-and-save-output.csBilateralSmoothingFilterOptions, RasterImageCreate BilateralSmoothingFilterOptions with size parameter set to 5, apply to PN...
apply-sharpenfilteroptions-after-median-filtering-to-accentuate-edges-in-a-cleaned-raster-image.csMedianFilterOptions, RasterImage, SharpenFilterOptionsApply SharpenFilterOptions after median filtering to accentuate edges in a clean...
load-multiple-emf-files-remove-backgrounds-using-specified-color-rasterize-each-to-png-and-log-processing-time.csEmfImage, EmfRasterizationOptions, PngOptionsLoad multiple EMF files, remove backgrounds using specified color, rasterize eac...
implement-a-console-application-that-accepts-image-path-arguments-applies-auto-masking-and-writes-png-output-to.csMaskingOptions, PngOptions, RasterImageImplement a console application that accepts image path arguments, applies auto‑...
configure-automaskinggraphcutoptions-to-reuse-strokes-across-iterations-improving-mask-accuracy-for-a-series-of.csAutoMaskingGraphCutOptions, PngOptions, RasterImageConfigure AutoMaskingGraphCutOptions to reuse strokes across iterations, improvi...
use-detectedobjectlist-from-a-prior-analysis-to-seed-graph-cut-algorithm-for-more-precise-background-segmentation.csAutoMaskingGraphCutOptions, PngOptions, RasterImageUse DetectedObjectList from a prior analysis to seed Graph Cut algorithm for mor...
apply-median-filter-with-kernel-size-3-to-a-png-after-background-removal-to-smooth-minor-artifacts.csMedianFilterOptions, RasterImageApply median filter with kernel size 3 to a PNG after background removal to smoo...
run-gauss-wiener-filter-with-default-parameters-on-a-rasterized-vector-image-to-reduce-blur-introduced-during.csGaussWienerFilterOptions, RasterImageRun Gauss‑Wiener filter with default parameters on a rasterized vector image to ...
apply-motion-wiener-filter-with-motion-vector-set-to-horizontal-direction-on-a-png-captured-from-video.csMotionWienerFilterOptions, RasterImageApply Motion‑Wiener filter with motion vector set to horizontal direction on a P...
combine-bilateral-smoothing-and-sharpening-filters-sequentially-on-a-raster-image-to-achieve-noise-reduction-and.csBilateralSmoothingFilterOptions, RasterImage, SharpenFilterOptionsCombine bilateral smoothing and sharpening filters sequentially on a raster imag...
align-resolutions-of-a-loaded-svg-before-rasterization-to-ensure-consistent-dpi-in-the-resulting-png-file.csPngOptions, SvgImage, SvgRasterizationOptionsAlign resolutions of a loaded SVG before rasterization to ensure consistent DPI ...
create-a-reusable-method-that-loads-a-raster-image-applies-auto-masking-median-filter-and-returns-processed-bitmap.csPngOptions, RasterImageCreate a reusable method that loads a raster image, applies auto‑masking, median...
develop-a-unit-test-that-verifies-background-removal-on-a-png-yields-transparent-pixels-where-original-background.csMaskingOptions, PngOptions, RasterImageDevelop a unit test that verifies background removal on a PNG yields transparent...
measure-performance-difference-between-graph-cut-auto-masking-with-default-strokes-and-with-custom-user-strokes.csAutoMaskingGraphCutOptions, PngOptions, RasterImageMeasure performance difference between Graph Cut auto‑masking with default strok...
load-a-png-align-its-resolutions-then-apply-bilateral-smoothing-before-saving-to-preserve-aspect-ratio.csBilateralSmoothingFilterOptionsLoad a PNG, align its resolutions, then apply bilateral smoothing before saving ...
...and 400 more filesView all

Category Statistics

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

Key API Surface

  • ApngFrame
  • ApngImage
  • ApngOptions
  • AutoMaskingGraphCutOptions
  • BackgroundRemovalFilterOptions
  • BilateralSmoothingFilterOptions
  • BmpImage
  • BmpOptions
  • CdrImage
  • CdrLoadOptions
  • CdrRasterizationOptions
  • EmfImage
  • EmfOptions
  • EmfRasterizationOptions
  • GaussWienerFilterOptions
  • GaussianBlurFilterOptions
  • GifImage
  • GifOptions
  • GraphCutMaskingOptions
  • Graphics
  • JpegImage
  • JpegOptions
  • LinearGradientBrush
  • LoadOptions
  • MaskingOptions
  • MedianFilterOptions
  • MetaImage
  • MotionWienerFilterOptions
  • MultiPageOptions
  • PdfCoreOptions
  • PdfOptions
  • PngImage
  • PngOptions
  • PsdOptions
  • RasterCachedImage
  • RasterImage
  • SharpenFilterOptions
  • SolidBrush
  • SvgImage
  • SvgOptions
  • SvgRasterizationOptions
  • TiffFrame
  • TiffImage
  • TiffOptions
  • VectorImage
  • VectorRasterizationOptions
  • WebPImage
  • WmfImage
  • WmfRasterizationOptions

Failed Tasks

All tasks passed ✅

Operations Covered

  • Export PSD to PNG with custom fonts
  • Load PSD image file
  • Set custom fonts folder for rendering
  • Generate APNG with smoothing mode enabled
  • Apply Gaussian blur to CDR images
  • Merge multiple images into multipage TIFF
  • Binarize image using Bradley threshold algorithm
  • Batch convert TIFF to PDF with anti‑aliasing
  • Configure multiple font directories for TIFF‑to‑PDF conversion
  • Rotate PNG image 45° with transparent background

Supported Formats

  • PSD – source Photoshop file that is loaded and converted.
  • PNG – input raster image and static output format.
  • APNG – animated PNG format used for output with smoothing mode.
  • CDR – CorelDRAW source files processed (blur applied).
  • TIFF – source format and multipage container for merged images.
  • PDF – target format for high‑quality TIFF‑to‑PDF conversion.

API Classes Used

  • Image — base class for loading and saving images.
  • Image.Load(string) — static method that reads an image file and returns an appropriate Image object.
  • RasterImage — derived class that provides raster‑specific operations such as filters and binarization.
  • RasterImage.BinarizeBradley(int, int) — applies the Bradley threshold algorithm to a raster image.
  • FontSettings — static class for configuring custom font directories and refreshing the font cache.
  • FontSettings.SetFontsFolder(string) — sets the folder that contains user‑defined fonts.
  • FontSettings.UpdateFonts() — reloads the font collection after changes.

Use Cases

  • When you need to export a PSD file as PNG while preserving custom font appearance, you can point Aspose.Imaging to a folder of user‑defined fonts with FontSettings.SetFontsFolder, load the PSD, and save it using PngOptions – this keeps the text rendering identical to the original design.
  • If your workflow requires applying Gaussian blur to multiple CDR files and merging the blurred results into a multipage TIFF, load each .cdr file, apply GaussianBlurFilter, and add the processed images to a TiffImage collection before saving the combined document.
  • To generate an animated PNG from a series of PNG frames with smoother edges, enable the smoothing mode in the APNG options (ApngOptions.SmoothingMode = SmoothingMode.AntiAlias) before calling image.Save(outputPath, new ApngOptions()).
  • When you want to use the Bradley threshold algorithm to binarize an image and output the result as an APNG, cast the loaded image to RasterImage, call BinarizeBradley, and then save the processed raster using ApngOptions.
  • For high‑quality batch conversion of TIFF images to PDF where visual fidelity matters, set the smoothing/anti‑aliasing mode in the PDF options (PdfOptions.SmoothingMode = SmoothingMode.AntiAlias) to ensure crisp text and graphics in the final PDF.

Related Categories

Manipulating images often goes hand‑in‑hand with format conversion, so the examples here complement the Convert Cdr and Convert Raster Image categories, where you can learn how to read and write CorelDRAW or generic raster files before applying filters.
If you need to apply additional visual effects such as sharpening or color adjustments, the Image And Photo Filters category provides a wide range of filter options that can be combined with the Gaussian blur or Bradley threshold workflows shown above.
Finally, when you want to combine several processed pages into a single document, the Merge Images category demonstrates techniques for stitching images together, which aligns naturally with the multipage TIFF merging scenario.

Get Started

Ready to try Manipulating Images 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: 20260723_031247 | Examples: 425

<!-- AUTOGENERATED:END -->

Developer Q&A

Q: How can I export a PSD file to PNG with custom fonts using Aspose.Imaging for .NET?

Load the PSD with PsdImage, add your fonts to a FontSettings object and assign it to the image, then save using PngOptions. → See: add-user-defined-fonts-to-fontsettings-and-export-a-psd-as-png-with-accurate-text-appearance.cs

Q: What is the Aspose.Imaging code to apply a median filter to an APNG image in C#?

Open the APNG with Image.Load, create a MedianFilter and call image.ApplyFilter(filter), then save with ApngOptions. → See: apply-median-and-wiener-filters-to-images-saved-in-the-apng-format-for-enhanced-noise-reduction.cs

Q: How do I batch convert multiple CDR files to individual PDF documents while preserving vector shapes using Aspose.Imaging?

Iterate over the CDR files, load each with CdrImage, set PdfOptions (including vector rasterization settings), and call image.Save(pdfPath, pdfOptions). → See: batch-export-emf-text-from-multiple-cdr-files-to-individual-pdf-documents-with-vector-shape-conversion.cs

Q: How can I configure Aspose.Imaging to use several font folders when converting a TIFF to PDF in C#?

Create a FontSettings instance, add each directory via FontSettings.AddFontFolder, assign it to the TIFF image, and save with PdfOptions. → See: configure-fontsettings-with-multiple-font-directories-for-tiff-to-pdf-conversion-to-support-diverse-scripts.cs

Q: How do I deskew an image and save the corrected result as an APNG while keeping transparency using Aspose.Imaging?

Load the image, apply DeskewFilter with image.ApplyFilter(new DeskewFilter()), then save using ApngOptions which preserves the alpha channel. → See: deskew-an-image-and-save-the-corrected-result-as-an-apng-file-preserving-visual-integrity.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.