Repository navigation
TDD: pure C# PNG/JPEG/BMP and full-frame animated GIF/APNG codecs with coverage gates - #31
Open
mikasoukhov wants to merge 85 commits into
Open
mikasoukhov wants to merge 85 commits into
mikasoukhov wants to merge 85 commits into
Conversation
…ndency-free tests
…liased scan conversion
… corruption across OSes
…ragile large fixtures
…be YCCK (APP14 transform 2)
…split IDAT and malformed chunk ordering
…acle in both JPEG decoders
…cutive split IDAT streams
…PEG restart markers
…300 fuzzed TTF inputs
…ptions and correct mutated signature oracle
…op/disposal/APNG/watermark regressions
…er and BGRA V4 encoder
…osal, delays, interlace and looping
…PNG with all frames and delays
…atermark, GIF frame access and APNG conversion
…rter than six bytes
…, alpha, watermark and corruptions
…tensions and LZW corruption fixtures
…F, plus timings and sequence numbers
…/delays/looping with CRC verification
…omposited frames to callers
… error regressions
…cs and test coverage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pure-managed PNG/JPEG/BMP/GIF/APNG with end-to-end animated frame preservation
No GDI+, SkiaSharp, ImageSharp, P/Invoke or OS-native image codecs. Cross-platform .NET 6 / .NET 10 (Windows, Linux, macOS).
Public functionality
GetImageSize: PNG/APNG, JPEG, BMP and GIF dimensions.ResizeImage: preserve source container and aspect ratio. PNG → PNG, JPEG → JPEG, BMP → BMP (portable top-down BGRA32 V4), GIF → animated GIF and APNG → animated APNG. Every frame is resized, retaining delays and looping; no upscaling.ConvertToPng: all still formats → RGBA8 PNG; GIF → animated PNG (APNG) with every displayed frame and its delay/loop count. APNG → validated unchanged APNG.AddTextWatermark: render on every GIF/APNG frame, returning GIF/APNG respectively; BMP → BMP; PNG/JPEG → PNG. Original image data never mutated; managed TrueType/Verdana fallback.GetGifFrames,GetGifLoopCount,GetAnimationFrames,GetAnimationLoopCount: access full-canvas RGBA8 frames and timing, including APNG.Image formats implemented
Test-first evidence
BmpGifTddTests.cs; BMP/GIF code then added inBmpCodec.cs,GifCodec.cs,ApngEncoder.csandApngDecoder.cs.Known format limitations
GIF has palette/binary-transparency limitations by specification: output preserves exact RGB for up to 255 opaque distinct colors/frame; otherwise uses palette quantization. Alpha under 128 becomes transparent. GIF encoder favors deterministic validity over maximum compression.
Unsupported specialized BMP embedded JPEG/PNG, GIF plain-text overlay rendering, arithmetic/lossless/12-bit JPEG and unrelated WebP/TIFF/HEIC/AVIF/SVG formats. No bundled licensed fonts. Native code packages are not introduced. Input/frame limits guard memory usage.
PR is ready for review; do not merge to master until review.