ChromaFx.Core
0.7.0
See the version list below for details.
dotnet add package ChromaFx.Core --version 0.7.0
NuGet\Install-Package ChromaFx.Core -Version 0.7.0
<PackageReference Include="ChromaFx.Core" Version="0.7.0" />
<PackageVersion Include="ChromaFx.Core" Version="0.7.0" />
<PackageReference Include="ChromaFx.Core" />
paket add ChromaFx.Core --version 0.7.0
#r "nuget: ChromaFx.Core, 0.7.0"
#:package ChromaFx.Core@0.7.0
#addin nuget:?package=ChromaFx.Core&version=0.7.0
#tool nuget:?package=ChromaFx.Core&version=0.7.0
Modern .NET image processing library.
A lean, managed alternative for .NET apps that need image processing without native codec DLLs.
Key points:
- Pure managed C# on .NET 10 — no third-party NuGet dependencies, no native codec binaries to deploy (BMP, PNG, JPEG, GIF, TGA, TIFF, ICO)
- Uses
Span<T>,ArrayPool, and SIMD on key paths - Explicit
Mutate/Cloneprocessing API with a pipeline-friendly fluent context - Typed encoders (
JpegEncoder,PngEncoder, …) and a publicImageFormatsregistry for extensions Load/LoadAsyncfrom path, stream,byte[], memory, or span; matchingSave/SaveAsyncDecodeLimitsfor untrusted input (default 32M pixels / 256 MiB) — tighten per call or viaDecodeLimits.Default- Terminal rendering (
ChromaFx.Processing.Terminal) — ASCII/ANSI art plus Kitty, iTerm2, and Sixel inline images; HTML art inChromaFx.Processing.HtmlArt - Adaptive
Quantizein Processing (DitherMethod, shared Core octree with GIF encode) - Opt-in packs:
PixelArt,Retro,Native(WebP / AVIF / JPEG XL) — see Packages below
Performance & Architecture
Fully managed on .NET 10 — no native codec binaries for Docker/Lambda multi-arch. Native code can still edge out pure managed pixel loops; ChromaFx prioritizes deployability and allocation-conscious processing for typical decode → filter → encode pipelines. Measure with tests/ChromaFx.Benchmarks for your scenario.
Packages
| Package | Description | NuGet Link |
|---|---|---|
ChromaFx |
Meta-package for .NET 10 (Core + IO + Processing). |
ChromaFx |
ChromaFx.Core |
Core types (ImageSimilarity, ColorDifference, Image.Metadata). |
ChromaFx.Core |
ChromaFx.IO |
Image file IO; JPEG/PNG/TIFF EXIF·XMP preserve (Native still bags with WebP/AVIF/JXL). | ChromaFx.IO |
ChromaFx.Processing |
Filters and effects (Curves, Perspective). |
ChromaFx.Processing |
ChromaFx.PixelArt |
Opt-in pixel-art upscaling (Scale2x / Scale3x, Hq2x–4x, CleanEdge, Eagle, SaI) and RotateSprite / CleanEdgeRotate. Not in the meta-package. |
ChromaFx.PixelArt |
ChromaFx.Retro |
Opt-in retro palettes + Bayer, UI/mode helpers, Millennium / classic FX / plasma / fire. Not in the meta-package. | ChromaFx.Retro |
ChromaFx.Native |
Opt-in WebP, AVIF, and JPEG XL (still + animated). Not in the meta-package. | ChromaFx.Native |
- Use
ChromaFxfor new projects targeting .NET 10. - Use
ChromaFx.Core,ChromaFx.IO, andChromaFx.Processingfor modular usage. - Add
ChromaFx.PixelArtfor Scale2x / Scale3x / Hq2x–4x / CleanEdge / Eagle / SaI orRotateSprite/CleanEdgeRotate. - Add
ChromaFx.Retrofor retro palettes, UI/mode helpers, and FX through plasma/fire (see filters guide). - Add
ChromaFx.Nativefor WebP, AVIF, and JPEG XL (still + animated).
Installation
Current NuGet line is 0.7.0 (tag-only releases; 0.x may still change before 1.0):
dotnet add package ChromaFx
# optional:
dotnet add package ChromaFx.PixelArt
dotnet add package ChromaFx.Retro
dotnet add package ChromaFx.Native # WebP / AVIF / JPEG XL
Samples
| Project | What it shows |
|---|---|
samples/TextArt |
ASCII / ANSI / HTML / Kitty / iTerm2 / Sixel |
samples/PixelArt |
Scale2x / HQX / Eagle / SaI / CleanEdgeRotate → PNGs |
samples/NativeCodecs |
WebP / AVIF / JPEG XL still + animated round-trip (needs native/build.sh) |
dotnet run --project samples/TextArt
dotnet run --project samples/PixelArt
./native/build.sh && dotnet run --project samples/NativeCodecs
Getting Started
// With PackageReference to ChromaFx, common namespaces are injected.
var thumb = Image.Load("input.png")
.Clone(ctx => ctx
.Resize(200, 200)
.Rotate(90)
.Invert());
thumb.Save("output.jpg", new JpegEncoder { Quality = 85 });
Image.Load("input.png")
.Mutate(ctx => ctx.Resize(800, 600).Brightness(0.1f))
.Save("output.png");
var fromBytes = Image.Load(pngBytes); // zero-copy when array-backed
var image = await Image.LoadAsync("input.png"); // async read, sync decode
Console.Write(image.ToAsciiArt(new AsciiArtOptions { MaxWidth = 40, Invert = true }));
API notes
- Prefer the
ChromaFxmeta-package (ChromaFx.Core+.IO+.Processing). Add PixelArt / Retro / Native packs separately (see Packages). - Decode limits: untrusted bytes use
DecodeLimits.Default(32M pixels, 256 MiB input, 16 MiB chunks, 10k frames). Override per call (Image.Load(stream, limits)) orusing (DecodeLimits.Push(limits)). Hostile decode failures throwImageException. Image.Load/Save/ImageFormatslive in IO; Mutate/Clone in Processing.- Fluent context: core ops on
IImageProcessingContext, more via extensions (BoxBlur,Saturation,Dilate,Greyscalealias, …); primary greyscale op isGrayscale(); escape hatchApply(IFilter). - Typed encoders:
ChromaFx.IO.Encoders(JpegEncoder,PngEncoder,BmpEncoder,GifEncoderasIAnimationEncoder,TgaEncoder,TiffEncoder,IcoEncoder). Native pack:WebPEncoder/AvifEncoder/JxlEncoder. - JPEG/PNG/TIFF and Native still WebP/AVIF/JPEG XL decode apply EXIF orientation where available and preserve
Image.Metadata(EXIF·XMP) on encode with orientation forced to 1. - Format ids are
ImageFormatKeyvalues (the name, compared ordinal-ignore-case).ManagedFormatsnames the managed codecs.NativeFormatsinChromaFx.Nativenames WebP, AVIF, and JPEG XL.Save(stream, key)uses the last registered format's encoder. A missing key throws. Animationdelays are GIF centiseconds (GetFrameDelayCs/SetFrameDelayCs/FrameDelaysCs/DelayCs);GetFrameDelay/SetFrameDelayuseTimeSpan.- Path
Save/SaveAsyncuse the last registered format that accepts the extension (plugins can override built-ins).ImageFormats.TryGetFormatlooks up by id and returns the first match. - Meta-package injects common usings via
buildTransitive/ChromaFx.props. - Pack with
dotnet pack(not on every local build).
Migration (breaking)
These older APIs are removed (not obsolete). 0.6.5 filter renames (Constrict → Erode, Sepiatone → Sepia, XOr → Xor, *Channel / *Matrix / *Base, …) are listed in CHANGELOG.md and the migration guide.
| Removed | Use instead |
|---|---|
img.Apply(...) / img.Apply<T>() |
img.Mutate(c => c.Invert()) / c.Apply(filter) |
img.Process(...) / ImagePipeline |
img.Mutate / Clone |
ImageOperatorExtensions (BrightnessUp, …) |
Clone/Mutate + context ops |
img.Copy() |
img.Clone() |
img.Save(path) → bool |
void (throws) |
IImageFormat.Encode → bool |
void (throws) |
LoadAnimation(path) |
Animation.Load(path) |
FormatManager / Manager |
ImageFormats.Register |
IFormat |
IImageFormat |
ManagedFormats enum (WebP, Avif, JpegXl included) |
ImageFormatKey; managed ids stay on ManagedFormats, native ids are NativeFormats |
FileFormats (format id holder) |
ManagedFormats (same members; registry remains ImageFormats) |
QuantizeDitherMethod |
DitherMethod (Processing adaptive Quantize) |
RetroDitherMethod |
Core OrderedDitherMethod (Retro fixed palettes) |
Scale2xHelpers.ApplyPasses(image, n) |
PixelArt2xHelpers.ApplyPasses(image, PixelArt2xAlgorithm.Scale2x, n) |
| Public format types as the only API | Prefer ImageFormats / typed encoders (built-in *Format types are internal) |
Temperature |
KelvinTint (same Helland math; illuminant tint, not white balance). Pair with Tint for green↔magenta; use WhiteBalance / AutoWhiteBalance for photographic correction |
Requirements
- .NET 10 SDK
Documentation
Guides: chromafx.net (chromafx/chromafx-site).
Changelog
See CHANGELOG.md for notable changes.
License
Apache 2.0 - see LICENSE
Attribution
This project is a fork of Structure.Sketching, originally developed by JaCraig under the Apache License 2.0.
Modifications and ongoing maintenance by Ho Tzin Mein (2023–2026).
Status
NuGet 0.7.0. ChromaLab v0.5.0.
Contributing
Contributions, bug reports, and suggestions are welcome.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on ChromaFx.Core:
| Package | Downloads |
|---|---|
|
ChromaFx
Modern, high-performance .NET image processing and drawing library. Supports PNG, JPEG, BMP, and GIF, with pipeline-friendly APIs. Targets .NET 10. |
|
|
ChromaFx.IO
Image file input/output support for ChromaFx. Load, save, and convert images in PNG, JPEG, BMP, GIF, TGA, TIFF, and ICO formats. |
|
|
ChromaFx.Processing
Image processing algorithms and effects for ChromaFx. Includes transformations, filters, and pixel-level operations for high-performance image workflows. |
|
|
ChromaFx.PixelArt
Pixel-art upscaling and rotation for ChromaFx. Scale2x/3x/4x/8x (EPX), Hq2x–4x, CleanEdge, Eagle/SaI, RotSprite RotateSprite, and CleanEdgeRotate. |
|
|
ChromaFx.Retro
Retro hardware palettes, 90s web/Win9x UI looks, and early-2000s filter effects for ChromaFx. Opt-in pack (not in the meta-package). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.1 | 60 | 12/4/2026 |
| 0.7.0 | 135 | 12/2/2026 |
| 0.6.7 | 189 | 11/28/2026 |
| 0.6.6 | 174 | 11/20/2026 |
| 0.6.5 | 180 | 11/18/2026 |
| 0.6.4 | 184 | 11/16/2026 |
| 0.6.3 | 175 | 11/14/2026 |
| 0.6.2 | 167 | 11/6/2026 |
| 0.6.1 | 160 | 11/4/2026 |
| 0.6.0 | 154 | 11/3/2026 |
| 0.5.0-beta.53 | 99 | 11/3/2026 |
| 0.5.0-beta.52 | 93 | 11/3/2026 |
| 0.5.0-beta.51 | 90 | 11/3/2026 |
| 0.5.0-beta.50 | 93 | 11/3/2026 |
| 0.5.0-beta.49 | 83 | 11/3/2026 |
| 0.5.0-beta.48 | 91 | 11/3/2026 |
| 0.5.0-beta.47 | 84 | 11/3/2026 |
| 0.5.0-beta.46 | 90 | 11/3/2026 |
| 0.5.0-beta.45 | 106 | 10/31/2026 |
| 0.4.0-beta.44 | 99 | 10/24/2026 |
0.7.0: Soft-freeze API reshape (Color R/G/B/A/Packed, Image Fill, helpers internal); DecodeLimits; still TIFF/WebP/AVIF/JXL Metadata; Terminal Sixel + cell metrics. See CHANGELOG.md / migration. API may still change before 1.0 (0.x).