agentic-net-examples / manipulating-images
AGENTS.md1 starsChanged 7 months agoMITView on GitHub
C# examples for Manipulating Images using Aspose.Imaging for .NET
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository17 other files it gives its agents.
- aspose-imaging-examplesAGENTS.md
- conversionAGENTS.md
- convert-apngAGENTS.md
- convert-cdrAGENTS.md
- convert-cmx-imagesAGENTS.md
- convert-dicom-imagesAGENTS.md
- convert-eps-imagesAGENTS.md
- converting-wmf-and-emfAGENTS.md
- convert-open-document-graphicsAGENTS.md
- convert-raster-imageAGENTS.md
- convert-svg-to-raster-imagesAGENTS.md
- convert-webp-imagesAGENTS.md
- image-and-photo-filtersAGENTS.md
- kernel-filtersAGENTS.md
- manipulate-different-image-file-formatsAGENTS.md
- merge-imagesAGENTS.md
- working-with-drawing-imagesAGENTS.md
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
- Very specific: line 183
If your workflow requires applying Gaussian blur to multiple CDR files and merging the blurred results into a multipage TIFF, load each …
- Very specific: line 185
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 …
- Distinctive: line 190
If you need to apply additional visual effects such as sharpening or color adjustments, the Image And Photo Filters category provides a …
- Very specific: line 227
Create a FontSettings instance, add each directory via FontSettings.AddFontFolder, assign it to the TIFF image, and save with PdfOptions.
≈ “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.
Files
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-specificusing Aspose.Imaging.ImageOptions;(186/430 files) ← category-specificusing Aspose.Imaging.Sources;(47/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Tiff;(45/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Png;(43/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Gif;(33/430 files) ← category-specificusing Aspose.Imaging.ImageFilters.FilterOptions;(24/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Tiff.Enums;(22/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Cdr;(21/430 files) ← category-specificusing Aspose.Imaging.Masking;(17/430 files) ← category-specificusing Aspose.Imaging.Masking.Options;(17/430 files) ← category-specificusing Aspose.Imaging.Masking.Result;(17/430 files) ← category-specificusing System.Collections.Generic;(14/430 files)using Aspose.Imaging.FileFormats.Jpeg;(11/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Bmp;(10/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Gif.Blocks;(10/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Svg;(6/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Pdf;(6/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Psd;(6/430 files) ← category-specificusing Aspose.Imaging.Brushes;(5/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Emf;(4/430 files) ← category-specificusing System.Diagnostics;(2/430 files)using System.Linq;(2/430 files)using Aspose.Imaging.Shapes;(1/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Emf.Emf.Records;(1/430 files) ← category-specificusing Aspose.Imaging.FileFormats.Emf.Emf.Objects;(1/430 files) ← category-specificusing Aspose.Imaging.CoreExceptions;(1/430 files) ← category-specificusing System.Text;(1/430 files)using Aspose.Imaging.FileFormats.Emf.Graphics;(1/430 files) ← category-specific
Files in this folder
| File | Key APIs | Description |
| load-a-png-image-apply-auto-masking-graph-cut-with-default-strokes-and-save-as-png.cs | AutoMaskingGraphCutOptions, PngOptions, RasterImage | Load 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.cs | AutoMaskingGraphCutOptions, PngOptions, RasterImage | Create 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.cs | PngOptions, RasterImage | Define 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.cs | AutoMaskingGraphCutOptions, PngOptions, RasterImage | Reuse previously configured AutoMaskingGraphCutOptions to refine background remo... |
| supply-a-detectedobjectlist-converted-to-assumedobjectdata-for-improved-graph-cut-segmentation-on-a-raster-image.cs | AutoMaskingGraphCutOptions, PngOptions, RasterImage | Supply a DetectedObjectList converted to AssumedObjectData for improved Graph Cu... |
| load-an-svg-vector-image-remove-its-background-using-default-analysis-and-save-as-png.cs | PngOptions, SvgImage, SvgRasterizationOptions | Load 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.cs | EmfImage, MetaImage | Remove 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.cs | CdrImage, MaskingOptions, PngOptions | Define 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.cs | PngOptions | After 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.cs | AutoMaskingGraphCutOptions, PngOptions, RasterImage | Batch 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.cs | PngOptions, SvgImage, SvgRasterizationOptions | Iterate 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.cs | MaskingOptions, PngOptions, RasterImage | Apply 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.cs | AutoMaskingGraphCutOptions, PngOptions, RasterImage | Combine 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.cs | MotionWienerFilterOptions, RasterImage, SharpenFilterOptions | Use 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.cs | Align 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.cs | BilateralSmoothingFilterOptions, RasterImage | Create BilateralSmoothingFilterOptions with size parameter set to 5, apply to PN... |
| apply-sharpenfilteroptions-after-median-filtering-to-accentuate-edges-in-a-cleaned-raster-image.cs | MedianFilterOptions, RasterImage, SharpenFilterOptions | Apply 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.cs | EmfImage, EmfRasterizationOptions, PngOptions | Load 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.cs | MaskingOptions, PngOptions, RasterImage | Implement a console application that accepts image path arguments, applies auto‑... |
| configure-automaskinggraphcutoptions-to-reuse-strokes-across-iterations-improving-mask-accuracy-for-a-series-of.cs | AutoMaskingGraphCutOptions, PngOptions, RasterImage | Configure AutoMaskingGraphCutOptions to reuse strokes across iterations, improvi... |
| use-detectedobjectlist-from-a-prior-analysis-to-seed-graph-cut-algorithm-for-more-precise-background-segmentation.cs | AutoMaskingGraphCutOptions, PngOptions, RasterImage | Use 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.cs | MedianFilterOptions, RasterImage | Apply 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.cs | GaussWienerFilterOptions, RasterImage | Run 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.cs | MotionWienerFilterOptions, RasterImage | Apply 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.cs | BilateralSmoothingFilterOptions, RasterImage, SharpenFilterOptions | Combine 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.cs | PngOptions, SvgImage, SvgRasterizationOptions | Align 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.cs | PngOptions, RasterImage | Create 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.cs | MaskingOptions, PngOptions, RasterImage | Develop 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.cs | AutoMaskingGraphCutOptions, PngOptions, RasterImage | Measure 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.cs | BilateralSmoothingFilterOptions | Load a PNG, align its resolutions, then apply bilateral smoothing before saving ... |
| ...and 400 more files | View all |
Category Statistics
- Total examples: 425
- Failed: 0
- Pass rate: 100.0%
Key API Surface
ApngFrameApngImageApngOptionsAutoMaskingGraphCutOptionsBackgroundRemovalFilterOptionsBilateralSmoothingFilterOptionsBmpImageBmpOptionsCdrImageCdrLoadOptionsCdrRasterizationOptionsEmfImageEmfOptionsEmfRasterizationOptionsGaussWienerFilterOptionsGaussianBlurFilterOptionsGifImageGifOptionsGraphCutMaskingOptionsGraphicsJpegImageJpegOptionsLinearGradientBrushLoadOptionsMaskingOptionsMedianFilterOptionsMetaImageMotionWienerFilterOptionsMultiPageOptionsPdfCoreOptionsPdfOptionsPngImagePngOptionsPsdOptionsRasterCachedImageRasterImageSharpenFilterOptionsSolidBrushSvgImageSvgOptionsSvgRasterizationOptionsTiffFrameTiffImageTiffOptionsVectorImageVectorRasterizationOptionsWebPImageWmfImageWmfRasterizationOptions
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 usingPngOptions– 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
.cdrfile, applyGaussianBlurFilter, and add the processed images to aTiffImagecollection 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 callingimage.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, callBinarizeBradley, and then save the processed raster usingApngOptions. - 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| Resource | Link |
| 📖 Documentation | docs.aspose.com/imaging/net |
| 📦 NuGet Package | www.nuget.org/packages/aspose.imaging |
| 🚀 Release Notes | releases.aspose.com/imaging/net |
| 🌐 Online Apps | products.aspose.app/imaging/family |
| 🔑 Free Temporary License | purchase.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
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
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.

