ChromaFx 0.6.2
dotnet add package ChromaFx --version 0.6.2
NuGet\Install-Package ChromaFx -Version 0.6.2
<PackageReference Include="ChromaFx" Version="0.6.2" />
<PackageVersion Include="ChromaFx" Version="0.6.2" />
<PackageReference Include="ChromaFx" />
paket add ChromaFx --version 0.6.2
#r "nuget: ChromaFx, 0.6.2"
#:package ChromaFx@0.6.2
#addin nuget:?package=ChromaFx&version=0.6.2
#tool nuget:?package=ChromaFx&version=0.6.2
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)
- Uses
Span<T>,ArrayPool, and SIMD on key paths - Explicit
Mutate/Cloneprocessing API - Typed encoders (
JpegEncoder,PngEncoder, …) and a publicImageFormatsregistry for extensions - Pipeline-friendly fluent context for common filters
Load/LoadAsyncfrom path, stream,byte[], memory, or span; matchingSave/SaveAsync- Terminal rendering (
ChromaFx.Processing.Terminal) — ASCII/ANSI art plus Kitty and iTerm2 inline images - Opt-in
ChromaFx.PixelArt— Scale2x / Scale3x / Hq2x–4x / CleanEdge / Eagle / SaI upscalers andRotateSprite/CleanEdgeRotate(not in the meta-package) - Opt-in
ChromaFx.Native— still WebP, AVIF, and JPEG XL (not in the meta-package; animated WebP/AVIF/JPEG XL are not supported)
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 and abstractions. | ChromaFx.Core |
ChromaFx.IO |
Image file IO, encoding/decoding support. | ChromaFx.IO |
ChromaFx.Processing |
Image processing algorithms and effects. | 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.Native |
Opt-in still WebP, AVIF, and JPEG XL. 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.Nativefor still WebP, AVIF, and JPEG XL. Animated WebP/AVIF/JPEG XL are not supported.
Installation
Current NuGet line is 0.6.2 (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.Native # still WebP / AVIF / JPEG XL
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). AddChromaFx.PixelArtseparately for pixel-art filters. Image.Load/Save/ImageFormatslive in IO; Mutate/Clone in Processing.- Fluent context: core ops on
IImageProcessingContext, more via extensions (BoxBlur,Saturation,Dilate,Grayscale, …); escape hatchApply(IFilter). - Typed encoders:
ChromaFx.IO.Encoders(JpegEncoder,PngEncoder,BmpEncoder,GifEncoderasIAnimationEncoder,TgaEncoder,TiffEncoder). Still WebP, AVIF, and JPEG XL encoders are inChromaFx.Native.Encoders. - Format ids are
ImageFormatKeyvalues (the name, compared ordinal-ignore-case).FileFormatsnames the managed codecs.NativeFormatsinChromaFx.Nativenames still WebP, AVIF, and JPEG XL.Save(stream, key)uses the last registered format's encoder. A missing key throws. Animationsupports per-frame delays (GetFrameDelay/SetFrameDelay/FrameDelays);Delaysets all frames.- 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):
| 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 |
FileFormats enum (WebP, Avif, JpegXl included) |
ImageFormatKey; managed ids stay on FileFormats, native ids are NativeFormats |
| Public format types as the only API | Prefer ImageFormats / typed encoders (BmpFormat etc. remain public for advanced use) |
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).
Roadmap
- ✅ Modularization – Core, IO, Processing packages split out.
- ✅ API modernization –
Mutate/Clone, typed encoders,ImageFormatsregistry. - ✅ PixelArt – opt-in
ChromaFx.PixelArt(Scale2x / Scale3x / Hq2x–4x / CleanEdge / Eagle / SaI,RotateSprite/CleanEdgeRotate). - ✅ Performance (pass) – Color ctor alloc fix; faster
ApplyRgbLut; AdaptiveThreshold / AdaptiveEqualize / Kuwahara / Blend alloc cuts. - ✅ Extended formats – managed TGA and TIFF; opt-in
ChromaFx.Nativestill WebP, AVIF, and JPEG XL (no animation). - ⏭ Extended features – more drawing/effects.
- ⏭ Performance – more Span/ArrayPool/SIMD on codecs and remaining filters.
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
- ChromaFx.Core (>= 0.6.2)
- ChromaFx.IO (>= 0.6.2)
- ChromaFx.Processing (>= 0.6.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.6.2 | 48 | 11/6/2026 |
| 0.6.1 | 73 | 11/4/2026 |
| 0.6.0 | 83 | 11/3/2026 |
| 0.5.0-beta.53 | 41 | 11/3/2026 |
| 0.5.0-beta.52 | 43 | 11/3/2026 |
| 0.5.0-beta.51 | 43 | 11/3/2026 |
| 0.5.0-beta.50 | 40 | 11/3/2026 |
| 0.5.0-beta.49 | 37 | 11/3/2026 |
| 0.5.0-beta.48 | 48 | 11/3/2026 |
| 0.5.0-beta.47 | 36 | 11/3/2026 |
| 0.5.0-beta.46 | 44 | 11/3/2026 |
| 0.5.0-beta.45 | 64 | 10/31/2026 |
| 0.4.0-beta.44 | 64 | 10/24/2026 |
| 0.4.0-beta.42 | 67 | 10/20/2026 |
| 0.4.0-beta.41 | 70 | 10/20/2026 |
| 0.4.0-beta.33 | 126 | 6/16/2026 |
| 0.4.0-beta.29 | 199 | 9/29/2025 |
| 0.4.0-beta.28 | 196 | 9/29/2025 |
| 0.4.0-beta.27 | 206 | 9/29/2025 |
| 0.4.0-beta.25 | 205 | 9/29/2025 |
0.6.2: managed TGA and TIFF; ChromaFx.Native still WebP, AVIF, and JPEG XL; FileFormats is an open ImageFormatKey. See CHANGELOG.md. API may still change before 1.0 (0.x).