### Load, Resize, and Save Image in C# Source: https://docs.sixlabors.com/articles/imagesharp/gettingstarted.html Demonstrates loading an image from a file, resizing it by half its original dimensions, and saving the modified image to a new file. This example utilizes ImageSharp's automatic format detection for loading and saving, and the Mutate and Resize methods for image manipulation. It also highlights the disposal of image resources. ```csharp using SixLabors.ImageSharp; using SixLabors.ImageSharp.Processing; // Open the file automatically detecting the file type to decode it. // Our image is now in an uncompressed, file format agnostic, structure in-memory as // a series of pixels. // You can also specify the pixel format using a type parameter (e.g. Image image = Image.Load("foo.jpg")) using (Image image = Image.Load("foo.jpg")) { // Resize the image in place and return it for chaining. // 'x' signifies the current image processing context. image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2)); // The library automatically picks an encoder based on the file extension then // encodes and write the data to disk. // You can optionally set the encoder to choose. image.Save("bar.jpg"); } // Dispose - releasing memory into a memory pool ready for the next image you wish to process. ``` -------------------------------- ### Fine-grained Processor and Cache Configuration Source: https://docs.sixlabors.com/articles/imagesharp.web/gettingstarted.html Demonstrates how to remove specific processors and configure cache options using the fluent API and factory methods. ```csharp services.AddImageSharp() .RemoveProcessor() .RemoveProcessor(); services.AddImageSharp() .Configure(options => { options.CacheFolder = "different-cache"; }); ``` -------------------------------- ### Initialize New Image with Specific Pixel Format in C# Source: https://docs.sixlabors.com/articles/imagesharp/gettingstarted.html Demonstrates the creation of a new, blank image with specified dimensions and a particular pixel format, `Rgba32` in this case. This is the starting point for drawing or manipulating image content from scratch. The `using` statement ensures proper disposal of the image resources. ```csharp using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; int width = 640; int height = 480; // Creates a new image with empty pixel data. using(Image image = new(width, height)) { // Do your drawing in here... } // Dispose - releasing memory into a memory pool ready for the next image you wish to process. ``` -------------------------------- ### Configure ImageSharp Middleware in Startup.cs Source: https://docs.sixlabors.com/articles/imagesharp.web/gettingstarted.html Demonstrates the standard registration of ImageSharp services and middleware. It emphasizes the importance of placing the middleware before static file serving to ensure proper image processing. ```csharp public void ConfigureServices(IServiceCollection services) { services.AddImageSharp(); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseImageSharp(); app.UseStaticFiles(); } ``` -------------------------------- ### Load and Create Font (C#) Source: https://docs.sixlabors.com/articles/fonts/gettingstarted.html Demonstrates the minimal steps to load a font file and create a font instance for use with ImageSharp.Drawing. This involves initializing a FontCollection, adding a font file, and creating a font with a specified size and style. ```csharp using SixLabors.Fonts; FontCollection collection = new(); FontFamily family = collection.Add("path/to/font.ttf"); Font font = family.CreateFont(12, FontStyle.Italic); // "font" can now be used in calls to DrawText from our ImageSharp.Drawing library. ``` -------------------------------- ### Legacy v1.x Cache Compatibility Configuration Source: https://docs.sixlabors.com/articles/imagesharp.web/gettingstarted.html Provides a comprehensive configuration example to replicate v1.x caching behavior in ImageSharp.Web v2.0.0+, including custom command parsing and cache key settings. ```csharp services.AddImageSharp(options => { options.CacheHashLength = 12; options.OnParseCommandsAsync = c => { if (c.Commands.Count == 0) return Task.CompletedTask; uint width = c.Parser.ParseValue(c.Commands.GetValueOrDefault(ResizeWebProcessor.Width), c.Culture); uint height = c.Parser.ParseValue(c.Commands.GetValueOrDefault(ResizeWebProcessor.Height), c.Culture); if (width > 4000 && height > 4000) { c.Commands.Remove(ResizeWebProcessor.Width); c.Commands.Remove(ResizeWebProcessor.Height); } return Task.CompletedTask; }; }) .Configure(options => { options.CacheFolderDepth = 12; }) .SetCacheKey() .ClearProviders() .AddProvider(); ``` -------------------------------- ### Advanced ImageSharp Service Configuration Source: https://docs.sixlabors.com/articles/imagesharp.web/gettingstarted.html Shows how to customize ImageSharp behavior using options delegates, including memory management, cache settings, and lifecycle hooks. ```csharp services.AddImageSharp( options => { options.Configuration = Configuration.Default; options.MemoryStreamManager = new RecyclableMemoryStreamManager(); options.BrowserMaxAge = TimeSpan.FromDays(7); options.CacheMaxAge = TimeSpan.FromDays(365); options.CacheHashLength = 8; options.OnParseCommandsAsync = _ => Task.CompletedTask; options.OnBeforeSaveAsync = _ => Task.CompletedTask; options.OnProcessedAsync = _ => Task.CompletedTask; options.OnPrepareResponseAsync = _ => Task.CompletedTask; }); ``` -------------------------------- ### Install ImageSharp.Web via Paket CLI Source: https://docs.sixlabors.com/articles/imagesharp.web/index.html Installs the ImageSharp.Web NuGet package using the Paket command-line tool. Replace VERSION_NUMBER with the desired package version. ```bash paket add SixLabors.ImageSharp.Web --version VERSION_NUMBER ``` -------------------------------- ### Advanced Font Loading and Measurement (C#) Source: https://docs.sixlabors.com/articles/fonts/gettingstarted.html Illustrates advanced font loading techniques, including adding multiple font files, TTC collections, and using fallback fonts for character support. It also shows how to measure text dimensions using TextMeasurer. ```csharp using SixLabors.Fonts; FontCollection collection = new(); collection.Add("path/to/font.ttf"); collection.Add("path/to/font2.ttf"); collection.Add("path/to/emojiFont.ttf"); collection.AddCollection("path/to/font.ttc"); if(collection.TryGet("Font Name", out FontFamily family)) if(collection.TryGet("Emoji Font Name", out FontFamily emojiFamily)) { // family will not be null here Font font = family.CreateFont(12, FontStyle.Italic); // TextOptions provides comprehensive customization options support TextOptions options = new(font) { // Will be used if a particular code point doesn't exist in the font passed into the constructor. (e.g. emoji) FallbackFontFamilies = new [] { emojiFamily } }; FontRectangle rect = TextMeasurer.MeasureAdvance("Text to measure", options); } ``` -------------------------------- ### Install ImageSharp.Web via .NET CLI Source: https://docs.sixlabors.com/articles/imagesharp.web/index.html Installs the ImageSharp.Web NuGet package using the .NET Command Line Interface. Replace VERSION_NUMBER with the desired package version. ```bash dotnet add package SixLabors.ImageSharp.Web --version VERSION_NUMBER ``` -------------------------------- ### Draw Polygons with ImageSharp Source: https://docs.sixlabors.com/articles/imagesharp.drawing/gettingstarted.html Demonstrates how to fill and outline polygon shapes like stars using the Mutate API. Includes both a minimal example for simple fills and an expanded example using custom brushes, pens, and drawing options. ```csharp using SixLabors.ImageSharp; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Drawing.Processing; Image image = ...; // create any way you like. Star star = new(x: 100.0f, y: 100.0f, prongs: 5, innerRadii: 20.0f, outerRadii:30.0f); image.Mutate( x=> x.Fill(Color.Red, star)); ``` ```csharp using SixLabors.ImageSharp; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Drawing.Processing; using SixLabors.ImageSharp.PixelFormats; Image image = ...; // Create any way you like. DrawingOptions options = new() { GraphicsOptions = new() { ColorBlendingMode = PixelColorBlendingMode.Multiply } }; PatternBrush brush = Brushes.Horizontal(Color.Red, Color.Blue); PatternPen pen = Pens.DashDot(Color.Green, 5); Star star = new(x: 100.0f, y: 100.0f, prongs: 5, innerRadii: 20.0f, outerRadii:30.0f); image.Mutate(x=> x.Fill(options, brush, star) .Draw(options, pen, star)); ``` -------------------------------- ### Install ImageSharp.Web via NuGet Package Manager Source: https://docs.sixlabors.com/articles/imagesharp.web/index.html Installs the ImageSharp.Web NuGet package using the Package Manager Console in Visual Studio. Replace VERSION_NUMBER with the desired package version. ```csharp PM > Install-Package SixLabors.ImageSharp.Web -Version VERSION_NUMBER ``` -------------------------------- ### Install ImageSharp via Package Managers Source: https://docs.sixlabors.com/articles/imagesharp/index.html Commands to install the SixLabors.ImageSharp library using common .NET package management tools. Ensure the correct version number is specified for your project requirements. ```powershell Install-Package SixLabors.ImageSharp -Version VERSION_NUMBER ``` ```bash dotnet add package SixLabors.ImageSharp --version VERSION_NUMBER ``` ```xml ``` ```bash paket add SixLabors.ImageSharp --version VERSION_NUMBER ``` -------------------------------- ### Install SixLabors.Fonts via Paket CLI Source: https://docs.sixlabors.com/articles/fonts/index.html Installs the SixLabors.Fonts NuGet package using the Paket command-line tool. Replace VERSION_NUMBER with the desired version. ```bash paket add SixLabors.Fonts --version VERSION_NUMBER ``` -------------------------------- ### Initialize PenOptions Struct Source: https://docs.sixlabors.com/api/ImageSharp.Drawing/SixLabors.ImageSharp.Drawing.Processing.PenOptions.html Demonstrates the various constructors available for creating a PenOptions instance, allowing configuration of stroke color, width, brush, and patterns. ```csharp public PenOptions(Color color, float strokeWidth); public PenOptions(Color color, float strokeWidth, float[]? strokePattern); public PenOptions(Brush strokeFill, float strokeWidth, float[]? strokePattern); public PenOptions(float strokeWidth); ``` -------------------------------- ### Initialize AdaptiveThresholdProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Binarization.AdaptiveThresholdProcessor.html Demonstrates the various constructors available for initializing the AdaptiveThresholdProcessor, allowing for customization of upper/lower colors and threshold limits. ```csharp public AdaptiveThresholdProcessor() public AdaptiveThresholdProcessor(Color upper, Color lower) public AdaptiveThresholdProcessor(Color upper, Color lower, float thresholdLimit) public AdaptiveThresholdProcessor(float thresholdLimit) ``` -------------------------------- ### Access Image Metadata in C# Source: https://docs.sixlabors.com/articles/imagesharp/gettingstarted.html Illustrates how to access both general and format-specific metadata from an image. After loading an image using `Image.Load` or `Image.Identify`, the `Metadata` property provides access to common profiles like Exif, Icc, Iptc, and Xmp. Format-specific metadata, such as JpegMetadata, can be retrieved using `GetFormatMetadata`. ```csharp Image image = Image.Load(@"image.jpg"); ImageMetadata imageMetaData = image.Metadata; // Syntactic sugar for imageMetaData.GetFormatMetadata(JpegFormat.Instance) JpegMetadata jpegData = imageMetaData.GetJpegMetadata(); ``` -------------------------------- ### Identify Image Dimensions and Metadata in C# Source: https://docs.sixlabors.com/articles/imagesharp/gettingstarted.html Shows how to use `Image.Identify` to quickly retrieve an image's dimensions and metadata without fully decoding the image data. This is useful for performance-critical scenarios where only image information is needed. The retrieved `ImageInfo` object contains width, height, and metadata properties. ```csharp ImageInfo imageInfo = Image.Identify(@"image.jpg"); Console.WriteLine($"Width: {imageInfo.Width}"); Console.WriteLine($"Height: {imageInfo.Height}"); ``` -------------------------------- ### Configure MAUI Android Release Build for Performance Source: https://docs.sixlabors.com/articles/imagesharp/gettingstarted.html This configuration snippet enables LLVM and AOT compilation for MAUI Android release builds. These settings are crucial for optimizing the performance of ImageSharp and other libraries by leveraging hardware acceleration and ahead-of-time compilation. Ensure your project targets Android and is set to 'Release' configuration for these properties to take effect. ```xml true true false ``` -------------------------------- ### protected abstract void OnFrameApply Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.CloningImageProcessor-1.html Documentation for the OnFrameApply method used to apply processing logic to source and destination image frames. ```APIDOC ## PROTECTED ABSTRACT void OnFrameApply ### Description Applies the process to the specified portion of the specified ImageFrame at the specified location and with the specified size. ### Method PROTECTED ABSTRACT ### Endpoint OnFrameApply(ImageFrame source, ImageFrame destination) ### Parameters #### Path Parameters - **source** (ImageFrame) - Required - The source image. Cannot be null. - **destination** (ImageFrame) - Required - The cloned/destination image. Cannot be null. ### Implements - ICloningImageProcessor - IImageProcessor - IDisposable ``` -------------------------------- ### FormatWebProcessor Constructor Source: https://docs.sixlabors.com/api/ImageSharp.Web/SixLabors.ImageSharp.Web.Processors.FormatWebProcessor.html Initializes a new instance of the FormatWebProcessor class using the provided middleware configuration options. ```csharp public FormatWebProcessor(IOptions options) ``` -------------------------------- ### RectangleF Top Property Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.RectangleF.html Gets the y-coordinate of the top edge of this RectangleF. This property is read-only and represents the rectangle's starting vertical position. ```csharp public float Top { get; } ``` -------------------------------- ### RectangleF Left Property Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.RectangleF.html Gets the x-coordinate of the left edge of this RectangleF. This property is read-only and represents the rectangle's starting horizontal position. ```csharp public float Left { get; } ``` -------------------------------- ### Initialize GlowProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Overlays.GlowProcessor.html Demonstrates the constructor for the GlowProcessor class, which requires GraphicsOptions and a Color to define the radial glow effect. ```csharp public GlowProcessor(GraphicsOptions options, Color color) ``` -------------------------------- ### Initialize ContrastProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Filters.ContrastProcessor.html Constructor for the ContrastProcessor class. It accepts a float value representing the contrast amount, where 0 results in grayscale, 1 maintains the original image, and values greater than 1 increase contrast. ```csharp public ContrastProcessor(float amount) ``` -------------------------------- ### Configure Rendering Origin Source: https://docs.sixlabors.com/api/Fonts/SixLabors.Fonts.TextOptions.html Sets or gets the rendering origin point for the text. This is typically a 2D vector defining the starting point of the text rendering. ```csharp public Vector2 Origin { get; set; } ``` -------------------------------- ### Initialize CloningImageProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.CloningImageProcessor-1.html Constructor for initializing the processor with configuration, source image, and the target source rectangle. ```csharp protected CloningImageProcessor(Configuration configuration, Image source, Rectangle sourceRectangle) ``` -------------------------------- ### Set Read Origin for Streams (C#) Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Configuration.html Gets or sets the starting position for reading image data from seekable streams. This affects how ImageSharp interprets the beginning of an image data source. ```csharp public ReadOrigin ReadOrigin { get; set; } ``` -------------------------------- ### BlackWhiteProcessor Constructor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Filters.BlackWhiteProcessor.html Initializes a new instance of the BlackWhiteProcessor class. ```APIDOC ## Constructor BlackWhiteProcessor() Initializes a new instance of the BlackWhiteProcessor class. ### Declaration ``` public BlackWhiteProcessor() ``` ``` -------------------------------- ### SepiaProcessor Constructor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Filters.SepiaProcessor.html Initializes a new instance of the SepiaProcessor class with a specified amount for the sepia filter. ```APIDOC ## SepiaProcessor(float amount) ### Description Initializes a new instance of the SepiaProcessor class. ### Method CONSTRUCTOR ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp // Example usage: SepiaProcessor processor = new SepiaProcessor(0.75f); ``` ### Response #### Success Response (N/A) This is a constructor and does not return a value in the traditional sense. #### Response Example N/A ``` -------------------------------- ### Get Pixel String Representation Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.PixelFormats.A8.html Gets a string representation of the packed vector. This is an override of the ValueType.ToString() method. ```csharp public override readonly string ToString() ``` -------------------------------- ### QuantizeProcessor Constructor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Quantization.QuantizeProcessor.html Initializes a new instance of the QuantizeProcessor class with a specific quantizer implementation. ```csharp public QuantizeProcessor(IQuantizer quantizer) ``` -------------------------------- ### Get or Set IccProfile Header Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Icc.IccProfile.html Gets or sets the header information for the ICC profile. This property is read-write. ```csharp public IccProfileHeader Header { get; set; } ``` -------------------------------- ### Initialize PaletteQuantizer Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Quantization.PaletteQuantizer.html Constructors for creating a new instance of PaletteQuantizer. These allow providing a color palette and optional quantization rules. ```csharp public PaletteQuantizer(ReadOnlyMemory palette) public PaletteQuantizer(ReadOnlyMemory palette, QuantizerOptions options) ``` -------------------------------- ### Get CodePoint Integer Value (C#) Source: https://docs.sixlabors.com/api/Fonts/SixLabors.Fonts.Unicode.CodePoint.html Gets the Unicode scalar value as an integer. This is the fundamental representation of the character. ```csharp public int Value { get; } ``` -------------------------------- ### Install ImageSharp.Web via PackageReference Source: https://docs.sixlabors.com/articles/imagesharp.web/index.html Adds ImageSharp.Web as a dependency to your project using the PackageReference format in the .csproj file. Replace VERSION_NUMBER with the desired package version. ```xml ``` -------------------------------- ### Get CodePoint Plane (C#) Source: https://docs.sixlabors.com/api/Fonts/SixLabors.Fonts.Unicode.CodePoint.html Gets the Unicode plane number (0 to 16) to which this scalar value belongs. The BMP is Plane 0. ```csharp public int Plane { get; } ``` -------------------------------- ### Initialize WuQuantizer Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Quantization.WuQuantizer.html Demonstrates the instantiation of the WuQuantizer class using either default settings or custom QuantizerOptions. This class is used to prepare image data for quantization processes. ```csharp public WuQuantizer() public WuQuantizer(QuantizerOptions options) ``` -------------------------------- ### Initialize SepiaProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Filters.SepiaProcessor.html Constructor for the SepiaProcessor class, requiring a float value between 0 and 1 to define the conversion proportion. ```csharp public SepiaProcessor(float amount) ``` -------------------------------- ### Get InkSet Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the InkSet EXIF tag. This property is used to get information about the ink set used in the image. ```csharp public static ExifTag InkSet { get; } ``` -------------------------------- ### Initialize LinearLineSegment Source: https://docs.sixlabors.com/api/ImageSharp.Drawing/SixLabors.ImageSharp.Drawing.LinearLineSegment.html Demonstrates the different ways to instantiate a LinearLineSegment using individual points, an array of points, or a combination of initial points and additional parameters. ```csharp var segment1 = new LinearLineSegment(new PointF(0, 0), new PointF(10, 10)); var segment2 = new LinearLineSegment(new PointF(0, 0), new PointF(5, 5), new PointF(10, 10)); var segment3 = new LinearLineSegment(new PointF[] { new PointF(0, 0), new PointF(10, 10) }); ``` -------------------------------- ### Initialize BlackWhiteProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Filters.BlackWhiteProcessor.html The constructor used to initialize a new instance of the BlackWhiteProcessor class. ```csharp public BlackWhiteProcessor() ``` -------------------------------- ### Install SixLabors.Fonts via .NET CLI Source: https://docs.sixlabors.com/articles/fonts/index.html Installs the SixLabors.Fonts NuGet package using the .NET Command Line Interface. Replace VERSION_NUMBER with the desired version. ```bash dotnet add package SixLabors.Fonts --version VERSION_NUMBER ``` -------------------------------- ### Implement Visit Method Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Advanced.IImageVisitor.html The Visit method provides a pixel-specific implementation for a given operation. It requires the pixel type to be unmanaged and implement IPixel. ```csharp void Visit(Image image) where TPixel : unmanaged, IPixel ``` -------------------------------- ### Get ImageWidth Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ImageWidth EXIF tag. This property is of type ExifTag and is used to get the width of the image in pixels. ```csharp public static ExifTag ImageWidth { get; } ``` -------------------------------- ### Get ImageSourceData Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ImageSourceData EXIF tag. This property is of type ExifTag and is used to get the source data of the image. ```csharp public static ExifTag ImageSourceData { get; } ``` -------------------------------- ### Initialize ImageCommandContext Source: https://docs.sixlabors.com/api/ImageSharp.Web/SixLabors.ImageSharp.Web.Middleware.ImageCommandContext.html The constructor initializes a new instance of the ImageCommandContext class. It requires the current HTTP context, a collection of commands, a command parser, and the culture information for parsing. ```csharp public ImageCommandContext(HttpContext context, CommandCollection commands, CommandParser parser, CultureInfo culture) ``` -------------------------------- ### Get ImageNumber Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ImageNumber EXIF tag. This property is of type ExifTag and is used to get the sequential number of the image. ```csharp public static ExifTag ImageNumber { get; } ``` -------------------------------- ### Get ImageLayer Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ImageLayer EXIF tag. This property is of type ExifTag and is used to get information about image layers. ```csharp public static ExifTag ImageLayer { get; } ``` -------------------------------- ### Initialize VonKriesChromaticAdaptation Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.ColorSpaces.Conversion.VonKriesChromaticAdaptation.html Constructors for creating an instance of the VonKriesChromaticAdaptation class, optionally providing a custom transformation matrix. ```csharp public VonKriesChromaticAdaptation() public VonKriesChromaticAdaptation(Matrix4x4 transformationMatrix) ``` -------------------------------- ### Get ImageID Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ImageID EXIF tag. This property is of type ExifTag and is used to get a unique identifier for the image. ```csharp public static ExifTag ImageID { get; } ``` -------------------------------- ### Get ImageDescription Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ImageDescription EXIF tag. This property is of type ExifTag and is used to get a textual description of the image. ```csharp public static ExifTag ImageDescription { get; } ``` -------------------------------- ### Initialize PathCollection Source: https://docs.sixlabors.com/api/ImageSharp.Drawing/SixLabors.ImageSharp.Drawing.PathCollection.html Constructors for creating a new PathCollection instance. It accepts either a variable number of IPath arguments or an enumerable collection of IPath objects. ```csharp public PathCollection(params IPath[] paths) public PathCollection(IEnumerable paths) ``` -------------------------------- ### AzureBlobStorageImageProvider Constructor Source: https://docs.sixlabors.com/api/ImageSharp.Web.Providers.Azure/SixLabors.ImageSharp.Web.Providers.Azure.AzureBlobStorageImageProvider.html Initializes a new instance of the provider using configuration options, format utilities, and the service provider. ```csharp public AzureBlobStorageImageProvider(IOptions storageOptions, FormatUtilities formatUtilities, IServiceProvider serviceProvider) ``` -------------------------------- ### PhysicalFileSystemProvider Constructor (C#) Source: https://docs.sixlabors.com/api/ImageSharp.Web/SixLabors.ImageSharp.Web.Providers.PhysicalFileSystemProvider.html This C# code shows the constructor for the PhysicalFileSystemProvider class. It takes IOptions for configuration, IWebHostEnvironment for environment details, and FormatUtilities for format helper methods. ```csharp public PhysicalFileSystemProvider(IOptions options, IWebHostEnvironment environment, FormatUtilities formatUtilities) ``` -------------------------------- ### Get InkNames Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the InkNames EXIF tag. This property is of type ExifTag and is used to get the names of the inks used in the image. ```csharp public static ExifTag InkNames { get; } ``` -------------------------------- ### Initialize WebSafePaletteQuantizer Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Quantization.WebSafePaletteQuantizer.html Constructors for the WebSafePaletteQuantizer class, including a parameterless constructor and one that accepts QuantizerOptions for custom quantization rules. ```csharp public WebSafePaletteQuantizer() public WebSafePaletteQuantizer(QuantizerOptions options) ``` -------------------------------- ### Get Indexed Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the Indexed EXIF tag. This property is of type ExifTag and is used to get information about indexed color spaces. ```csharp public static ExifTag Indexed { get; } ``` -------------------------------- ### Get ImageUniqueID Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ImageUniqueID EXIF tag. This property is of type ExifTag and is used to get a globally unique identifier for the image. ```csharp public static ExifTag ImageUniqueID { get; } ``` -------------------------------- ### Get ImageLength Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ImageLength EXIF tag. This property is of type ExifTag and is used to get the length (height) of the image in pixels. ```csharp public static ExifTag ImageLength { get; } ``` -------------------------------- ### Initialize Rational Struct Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Rational.html Demonstrates the various ways to instantiate a Rational struct, including constructors accepting doubles, unsigned integers, and optional simplification or precision flags. ```csharp public Rational(double value); public Rational(double value, bool bestPrecision); public Rational(uint value); public Rational(uint numerator, uint denominator); public Rational(uint numerator, uint denominator, bool simplify); ``` -------------------------------- ### Get ImageHistory Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ImageHistory EXIF tag. This property is of type ExifTag and is used to get a history of image modifications or events. ```csharp public static ExifTag ImageHistory { get; } ``` -------------------------------- ### Initialize GaussianBlurProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Convolution.GaussianBlurProcessor.html Various constructors for the GaussianBlurProcessor class, allowing configuration of the blur effect through sigma, radius, and border wrapping modes. ```csharp public GaussianBlurProcessor() public GaussianBlurProcessor(int radius) public GaussianBlurProcessor(float sigma) public GaussianBlurProcessor(float sigma, BorderWrappingMode borderWrapModeX, BorderWrappingMode borderWrapModeY) public GaussianBlurProcessor(float sigma, int radius) public GaussianBlurProcessor(float sigma, int radius, BorderWrappingMode borderWrapModeX, BorderWrappingMode borderWrapModeY) ``` -------------------------------- ### Get Humidity Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the Humidity EXIF tag. This property is of type ExifTag and is used to get humidity information associated with the image. ```csharp public static ExifTag Humidity { get; } ``` -------------------------------- ### Initialize and Invoke ImageSharpMiddleware Source: https://docs.sixlabors.com/api/ImageSharp.Web/SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.html The constructor initializes the middleware with necessary dependencies for image processing, including providers, processors, and caching utilities. The Invoke method processes the incoming HTTP request context to perform image operations. ```csharp public class ImageSharpMiddleware { public ImageSharpMiddleware(RequestDelegate next, IOptions options, ILoggerFactory loggerFactory, IRequestParser requestParser, IEnumerable resolvers, IEnumerable processors, IImageCache cache, ICacheKey cacheKey, ICacheHash cacheHash, CommandParser commandParser, FormatUtilities formatUtilities, AsyncKeyReaderWriterLock asyncKeyLock, RequestAuthorizationUtilities requestAuthorizationUtilities) { // Initialization logic } public Task Invoke(HttpContext httpContext) { // Request processing logic } } ``` -------------------------------- ### Constructors Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.SizeF.html Details on how to initialize a new instance of the SizeF struct. ```APIDOC ## Constructors ### SizeF(PointF) Initializes a new instance of the SizeF struct from the given PointF. #### Parameters * **point** (PointF) - The point. ### SizeF(SizeF) Initializes a new instance of the SizeF struct. #### Parameters * **size** (SizeF) - The size. ### SizeF(float, float) Initializes a new instance of the SizeF struct. #### Parameters * **width** (float) - The width of the size. * **height** (float) - The height of the size. ``` -------------------------------- ### Get HostComputer Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the HostComputer EXIF tag. This property is of type ExifTag and is used to get the name of the computer that created the image. ```csharp public static ExifTag HostComputer { get; } ``` -------------------------------- ### Install SixLabors.Fonts via Package Manager Console Source: https://docs.sixlabors.com/articles/fonts/index.html Installs the SixLabors.Fonts NuGet package using the Package Manager Console in Visual Studio. Replace VERSION_NUMBER with the desired version. ```powershell PM > Install-Package SixLabors.Fonts -Version VERSION_NUMBER ``` -------------------------------- ### WuQuantizer Constructors Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Quantization.WuQuantizer.html Details on how to initialize a new instance of the WuQuantizer class. ```APIDOC ## Constructors ### WuQuantizer() Initializes a new instance of the WuQuantizer class using the default QuantizerOptions. #### Declaration ```csharp public WuQuantizer() ``` ### WuQuantizer(QuantizerOptions options) Initializes a new instance of the WuQuantizer class. #### Declaration ```csharp public WuQuantizer(QuantizerOptions options) ``` #### Parameters | Type | Name | Description | |---|---|---| | QuantizerOptions | options | The quantizer options defining quantization rules. | ``` -------------------------------- ### Get ISOSpeedRatings Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ISOSpeedRatings EXIF tag. This property is of type ExifTag and is used to get the ISO speed ratings applied to the image. ```csharp public static ExifTag ISOSpeedRatings { get; } ``` -------------------------------- ### ContrastProcessor Class Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Filters.ContrastProcessor.html Documentation for initializing and using the ContrastProcessor to apply contrast adjustments to images. ```APIDOC ## ContrastProcessor ### Description Applies a contrast filter matrix to an image using a specified amount. ### Namespace SixLabors.ImageSharp.Processing.Processors.Filters ### Constructor #### ContrastProcessor(float amount) Initializes a new instance of the ContrastProcessor class. ### Parameters - **amount** (float) - Required - The proportion of the conversion. Must be greater than or equal to 0. A value of 0 results in a gray image, 1 leaves the image unchanged, and values > 1 increase contrast. ### Properties - **Amount** (float) - Gets the proportion of the conversion. ### Implementation - Implements `IImageProcessor` - Inherits from `FilterProcessor` ### Usage Example ```csharp // Example of initializing the processor float contrastAmount = 1.5f; var processor = new ContrastProcessor(contrastAmount); ``` ``` -------------------------------- ### Initialize WebRootImageProvider constructor Source: https://docs.sixlabors.com/api/ImageSharp.Web/SixLabors.ImageSharp.Web.Providers.WebRootImageProvider.html Constructor for the WebRootImageProvider class, requiring the web hosting environment and format utilities. This initializes the provider for use within the ImageSharp middleware pipeline. ```csharp public WebRootImageProvider(IWebHostEnvironment environment, FormatUtilities formatUtilities) ``` -------------------------------- ### Get HalftoneHints Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the HalftoneHints EXIF tag. This property is of type ExifTag and is used to get halftone hinting information from image metadata. ```csharp public static ExifTag HalftoneHints { get; } ``` -------------------------------- ### Initialize GaussianSharpenProcessor with Sigma, Radius, and Border Wrapping (C#) Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Convolution.GaussianSharpenProcessor.html Illustrates the most comprehensive initialization of GaussianSharpenProcessor, including sigma, radius, and border wrapping modes for both X and Y axes. This provides fine-grained control over the sharpening process and edge handling. ```csharp public GaussianSharpenProcessor(float sigma, int radius, BorderWrappingMode borderWrapModeX, BorderWrappingMode borderWrapModeY) ``` -------------------------------- ### Generate Outline with Width, Pattern, and Start Off Flag Source: https://docs.sixlabors.com/api/ImageSharp.Drawing/SixLabors.ImageSharp.Drawing.OutlinePathExtensions.html Generates a patterned outline where the starting segment can be specified as 'off'. This is useful for creating specific dashed line effects. ```csharp public static IPath GenerateOutline(this IPath path, float width, ReadOnlySpan pattern, bool startOff) ``` -------------------------------- ### Initialize ClipPathProcessor Source: https://docs.sixlabors.com/api/ImageSharp.Drawing/SixLabors.ImageSharp.Drawing.Processing.Processors.Drawing.ClipPathProcessor.html Defines the constructor for the ClipPathProcessor, requiring drawing options, an IPath for the region, and an action to perform on the image context. ```csharp public ClipPathProcessor(DrawingOptions options, IPath path, Action operation) ``` -------------------------------- ### ResizeProcessor Constructor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Transforms.ResizeProcessor.html Initializes a new instance of the ResizeProcessor class with specified options and source size. ```APIDOC ## Constructor ResizeProcessor(ResizeOptions, Size) Initializes a new instance of the ResizeProcessor class. ### Method ResizeProcessor ### Parameters #### Parameters - **options** (ResizeOptions) - Required - The resize options. - **sourceSize** (Size) - Required - The source image size. ``` -------------------------------- ### Get ISOSpeed Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ISOSpeed EXIF tag. This property is of type ExifTag and is used to get the ISO speed rating of the camera when the image was captured. ```csharp public static ExifTag ISOSpeed { get; } ``` -------------------------------- ### Initialize OctreeQuantizer Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Quantization.OctreeQuantizer-1.html Initializes a new instance of the OctreeQuantizer struct using the provided configuration and quantization options. ```csharp public OctreeQuantizer(Configuration configuration, QuantizerOptions options) ``` -------------------------------- ### Get GrayResponseUnit Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the GrayResponseUnit EXIF tag. This property is of type ExifTag and is used to get specific grayscale response information from image metadata. ```csharp public static ExifTag GrayResponseUnit { get; } ``` -------------------------------- ### Get UTF-8 Sequence Length (C#) Source: https://docs.sixlabors.com/api/Fonts/SixLabors.Fonts.Unicode.CodePoint.html Gets the number of UTF-8 code units required to represent this scalar value. The value will range from 1 to 4, depending on the Unicode value. ```csharp public int Utf8SequenceLength { get; } ``` -------------------------------- ### Initialize ProjectiveTransformProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Transforms.ProjectiveTransformProcessor.html Constructor to create a new instance of the processor with a transformation matrix, resampler, and target dimensions. ```csharp public ProjectiveTransformProcessor(Matrix4x4 matrix, IResampler sampler, Size targetDimensions) ``` -------------------------------- ### Get Replacement Character CodePoint (C#) Source: https://docs.sixlabors.com/api/Fonts/SixLabors.Fonts.Unicode.CodePoint.html Gets a static CodePoint instance representing the Unicode replacement character (U+FFFD). This character is often used to replace unknown or invalid characters. ```csharp public static CodePoint ReplacementChar { get; } ``` -------------------------------- ### OilPaintingProcessor Constructor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Effects.OilPaintingProcessor.html Initializes a new instance of the OilPaintingProcessor class with specified levels and brush size. ```APIDOC ## OilPaintingProcessor Constructor ### Description Initializes a new instance of the OilPaintingProcessor class. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **levels** (int) - Required - The number of intensity levels. Higher values result in a broader range of color intensities forming part of the result image. - **brushSize** (int) - Required - The number of neighboring pixels used in calculating each individual pixel value. ### Request Example ```json { "levels": 10, "brushSize": 5 } ``` ### Response #### Success Response (200) N/A (Constructor) #### Response Example N/A ``` -------------------------------- ### Get IccProfile Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the IccProfile EXIF tag. This property is of type ExifTag and is used to get the ICC (International Color Consortium) profile embedded in the image. ```csharp public static ExifTag IccProfile { get; } ``` -------------------------------- ### FileProviderImageProvider Constructor Source: https://docs.sixlabors.com/api/ImageSharp.Web/SixLabors.ImageSharp.Web.Providers.FileProviderImageProvider.html Details of the FileProviderImageProvider constructor, including parameters. ```APIDOC ## FileProviderImageProvider(IFileProvider, ProcessingBehavior, FormatUtilities) Initializes a new instance of the FileProviderImageProvider class. ### Method Protected Constructor ### Parameters #### Path Parameters - **fileProvider** (IFileProvider) - Required - The file provider. - **processingBehavior** (ProcessingBehavior) - Required - The processing behavior. - **formatUtilities** (FormatUtilities) - Required - Contains various format helper methods based on the current configuration. ``` -------------------------------- ### Get ISOSpeedLatitudeyyy Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ISOSpeedLatitudeyyy EXIF tag. This property is of type ExifTag and is used to get a specific ISO speed latitude value from image metadata. ```csharp public static ExifTag ISOSpeedLatitudeyyy { get; } ``` -------------------------------- ### Initialize FormatUtilities Source: https://docs.sixlabors.com/api/ImageSharp.Web/SixLabors.ImageSharp.Web.FormatUtilities.html Initializes a new instance of the FormatUtilities class using the provided ImageSharp middleware configuration options. ```csharp public FormatUtilities(IOptions options) ``` -------------------------------- ### Pixel Initialization Methods Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.PixelFormats.HalfVector2.html Methods used to initialize pixel instances from various source color formats. ```APIDOC ## POST /FromRgba32 ### Description Initializes the pixel instance from an Rgba32 value. ### Method POST ### Endpoint /FromRgba32 ### Parameters #### Request Body - **source** (Rgba32) - Required - The Rgba32 value. ### Response #### Success Response (200) - **status** (string) - Pixel initialized successfully. ``` -------------------------------- ### Get IPTC Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the IPTC EXIF tag. This property is of type ExifTag and is used to get IPTC (International Press Telecommunications Council) metadata from the image. ```csharp public static ExifTag IPTC { get; } ``` -------------------------------- ### PaletteQuantizer Constructor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Quantization.PaletteQuantizer.html Initializes a new instance of the PaletteQuantizer class with a specified color palette and optional quantization settings. ```APIDOC ## POST /PaletteQuantizer/Constructor ### Description Initializes a new instance of the PaletteQuantizer class using a provided color palette and optional configuration settings. ### Method POST ### Endpoint /PaletteQuantizer ### Parameters #### Request Body - **palette** (ReadOnlyMemory) - Required - The color palette to use for quantization. - **options** (QuantizerOptions) - Optional - The quantizer options defining quantization rules. ### Request Example { "palette": ["#FF0000", "#00FF00", "#0000FF"], "options": { "Dither": "FloydSteinberg" } } ### Response #### Success Response (200) - **status** (string) - Instance initialized successfully. #### Response Example { "status": "success" } ``` -------------------------------- ### Get ISOSpeedLatitudezzz Exif Tag Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag.html Retrieves the ISOSpeedLatitudezzz EXIF tag. This property is of type ExifTag and is used to get another specific ISO speed latitude value from image metadata. ```csharp public static ExifTag ISOSpeedLatitudezzz { get; } ``` -------------------------------- ### Get UTF-16 Sequence Length (C#) Source: https://docs.sixlabors.com/api/Fonts/SixLabors.Fonts.Unicode.CodePoint.html Gets the number of UTF-16 code units (chars) required to represent this scalar value. The value will be 1 for characters in the BMP and 2 for characters outside the BMP. ```csharp public int Utf16SequenceLength { get; } ``` -------------------------------- ### Initialize PngFrameMetadata Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Formats.Png.PngFrameMetadata.html Constructor for creating a new instance of the PngFrameMetadata class. ```csharp public PngFrameMetadata() ``` -------------------------------- ### Initialize RegularPolygon instances Source: https://docs.sixlabors.com/api/ImageSharp.Drawing/SixLabors.ImageSharp.Drawing.RegularPolygon.html Demonstrates the various constructor overloads available for the RegularPolygon class, allowing for definition via PointF or individual coordinate floats, with optional rotation angles. ```csharp public RegularPolygon(PointF location, int vertices, float radius); public RegularPolygon(PointF location, int vertices, float radius, float angle); public RegularPolygon(float x, float y, int vertices, float radius); public RegularPolygon(float x, float y, int vertices, float radius, float angle); ``` -------------------------------- ### Try Get Paired Bracket for BidiClass Source: https://docs.sixlabors.com/api/Fonts/SixLabors.Fonts.Unicode.BidiClass.html Attempts to get the codepoint representing the bracket pairing for the current BidiClass instance. This method returns true if a paired bracket is found, and outputs the corresponding CodePoint. ```csharp public bool TryGetPairedBracket(out CodePoint codePoint) ``` -------------------------------- ### Short4 Conversion Methods Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.PixelFormats.Short4.html Methods to initialize a Short4 pixel instance from various other pixel formats such as Abgr32, Argb32, and Bgr24. ```APIDOC ## POST /Short4/FromPixelType ### Description Converts various pixel types (e.g., Abgr32, Argb32, Bgr24) into the Short4 format. ### Method POST ### Parameters #### Request Body - **source** (Object) - Required - The source pixel object (e.g., Abgr32, L8, etc.) to convert from. ### Request Example { "source": { "value": 255 } } ### Response #### Success Response (200) - **status** (string) - Indicates successful conversion. ``` -------------------------------- ### Generate Outline with Width, Pattern, Start Off Flag, JointStyle, and EndCapStyle Source: https://docs.sixlabors.com/api/ImageSharp.Drawing/SixLabors.ImageSharp.Drawing.OutlinePathExtensions.html The most advanced outline generation method, allowing full customization of width, pattern, start state, joint styles, and end cap styles. ```csharp public static IPath GenerateOutline(this IPath path, float width, ReadOnlySpan pattern, bool startOff, JointStyle jointStyle, EndCapStyle endCapStyle) ``` -------------------------------- ### Initialize AdaptiveHistogramEqualizationProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Normalization.AdaptiveHistogramEqualizationProcessor.html Constructor for creating an instance of the processor with specified luminance levels, histogram clipping settings, and tile configuration. ```csharp public AdaptiveHistogramEqualizationProcessor(int luminanceLevels, bool clipHistogram, int clipLimit, int numberOfTiles) ``` -------------------------------- ### CommandCollection Indexer (string key) - C# Source: https://docs.sixlabors.com/api/ImageSharp.Web/SixLabors.ImageSharp.Web.Commands.CommandCollection.html Gets or sets the value associated with a specified key in the CommandCollection. If the key does not exist during a get operation, a KeyNotFoundException is thrown. During a set operation, if the key does not exist, a new element is created. ```csharp public string this[string key] { get; set; } ``` -------------------------------- ### Start New Figure - PathBuilder Source: https://docs.sixlabors.com/api/ImageSharp.Drawing/SixLabors.ImageSharp.Drawing.PathBuilder.html Starts a new figure within the current path, leaving the previous figure open. This is useful for creating disjointed shapes within a single path. It returns the PathBuilder instance. ```csharp public PathBuilder StartFigure() ``` -------------------------------- ### Initialize DrawImageProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Drawing.DrawImageProcessor.html Constructors for creating a new instance of DrawImageProcessor. These allow specifying the foreground image, target location, blending modes, and opacity, with an optional foreground rectangle for partial image drawing. ```csharp public DrawImageProcessor(Image foreground, Point backgroundLocation, PixelColorBlendingMode colorBlendingMode, PixelAlphaCompositionMode alphaCompositionMode, float opacity); public DrawImageProcessor(Image foreground, Point backgroundLocation, Rectangle foregroundRectangle, PixelColorBlendingMode colorBlendingMode, PixelAlphaCompositionMode alphaCompositionMode, float opacity); ``` -------------------------------- ### Access Quantizer Options Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Quantization.PaletteQuantizer.html Retrieves the configuration settings used for quantization rules. ```csharp public QuantizerOptions Options { get; } ``` -------------------------------- ### Install AWS S3 Storage Cache Provider (NuGet) Source: https://docs.sixlabors.com/articles/imagesharp.web/imagecaches.html Provides instructions for installing the AWS S3 Storage cache provider for ImageSharp.Web using various package managers. This enables caching processed images in Amazon S3 buckets. ```powershell PM > Install-Package SixLabors.ImageSharp.Web.Providers.AWS -Version VERSION_NUMBER ``` ```bash dotnet add package SixLabors.ImageSharp.Web.Providers.AWS --version VERSION_NUMBER ``` ```xml ``` ```bash paket add SixLabors.ImageSharp.Web.Providers.AWS --version VERSION_NUMBER ``` -------------------------------- ### Install Azure Blob Storage Cache Provider (NuGet) Source: https://docs.sixlabors.com/articles/imagesharp.web/imagecaches.html Provides instructions for installing the Azure Blob Storage cache provider for ImageSharp.Web using various package managers. This allows image processing results to be stored in Azure Blob Storage. ```powershell PM > Install-Package SixLabors.ImageSharp.Web.Providers.Azure -Version VERSION_NUMBER ``` ```bash dotnet add package SixLabors.ImageSharp.Web.Providers.Azure --version VERSION_NUMBER ``` ```xml ``` ```bash paket add SixLabors.ImageSharp.Web.Providers.Azure --version VERSION_NUMBER ``` -------------------------------- ### Constructor: AmazonS3BucketClient Source: https://docs.sixlabors.com/api/ImageSharp.Web.Providers.AWS/SixLabors.ImageSharp.Web.AmazonS3BucketClient.html Initializes a new instance of the AmazonS3BucketClient class with a specific bucket and client. ```APIDOC ## Constructor: AmazonS3BucketClient ### Description Initializes a new instance of the AmazonS3BucketClient class, linking a client to a specific S3 bucket. ### Method Constructor ### Parameters #### Path Parameters - **bucketName** (string) - Required - The bucket name associated with this client instance. - **client** (AmazonS3Client) - Required - The underlying Amazon S3 client instance. - **disposeClient** (bool) - Optional - A value indicating whether the underlying client should be disposed when this instance is disposed. Defaults to true. ### Request Example new AmazonS3BucketClient("my-bucket", s3Client, true); ``` -------------------------------- ### Initialize BinaryThresholdProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Binarization.BinaryThresholdProcessor.html Constructors for the BinaryThresholdProcessor class, allowing configuration of the threshold value, upper and lower colors, and the threshold mode. ```csharp public BinaryThresholdProcessor(float threshold) public BinaryThresholdProcessor(float threshold, Color upperColor, Color lowerColor) public BinaryThresholdProcessor(float threshold, Color upperColor, Color lowerColor, BinaryThresholdMode mode) public BinaryThresholdProcessor(float threshold, BinaryThresholdMode mode) ``` -------------------------------- ### Get Writable Row Span - IndexedImageFrame - SixLabors.ImageSharp Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.IndexedImageFrame-1.html Gets a writable span representing a row of pixels in the indexed image frame. Values written to this span are not sanitized against the palette length, so care must be taken to prevent out-of-bounds errors. ```csharp public Span GetWritablePixelRowSpanUnsafe(int rowIndex) ``` -------------------------------- ### GetWebpMetadata(ImageMetadata) Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.MetadataExtensions.html Gets the webp format specific metadata for the image. ```APIDOC ## GetWebpMetadata(ImageMetadata) ### Description Gets the webp format specific metadata for the image. ### Method GET ### Endpoint /websites/sixlabors/image/metadata/webp ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **metadata** (ImageMetadata) - Required - The metadata this method extends. ### Request Example ```json { "metadata": { ... } } ``` ### Response #### Success Response (200) - **WebpMetadata** (WebpMetadata) - The WebpMetadata. #### Response Example ```json { "webpMetadata": { ... } } ``` ``` -------------------------------- ### Initialize ResizeProcessor Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Processing.Processors.Transforms.ResizeProcessor.html Constructor for the ResizeProcessor class. It requires ResizeOptions and the source image size to define the transformation parameters. ```csharp public ResizeProcessor(ResizeOptions options, Size sourceSize) ``` -------------------------------- ### Initialize Image with Dimensions Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.Image-1.html Demonstrates how to instantiate a new Image object by specifying the configuration, width, and height. This is the standard approach for creating a blank canvas for image processing. ```csharp using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; // Initialize with configuration, width, and height var image = new Image(Configuration.Default, 800, 600); ``` -------------------------------- ### Get Frame Operation Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.ImageFrameCollection-1.html Retrieves the ImageFrame at the specified index. ```csharp protected override ImageFrame NonGenericGetFrame(int index) ``` -------------------------------- ### GET /IndexOf Source: https://docs.sixlabors.com/api/ImageSharp/SixLabors.ImageSharp.ImageFrameCollection.html Determines the index of a specific frame in the ImageFrameCollection. ```APIDOC ## GET /IndexOf ### Description Determines the index of a specific `frame` in the ImageFrameCollection. ### Method GET ### Endpoint /IndexOf ### Parameters #### Query Parameters - **frame** (ImageFrame) - Required - The ImageFrame to locate in the collection. ### Response #### Success Response (200) - **index** (int) - The index of the item if found; otherwise, -1. ```