Add WebP/BMP RGBA parsing and APNG format support#20
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Open
Agent-Logs-Url: https://github.com/echosoar/imgpro/sessions/f6157263-e53e-4b06-8672-a9aa14b34f47 Co-authored-by: echosoar <14832743+echosoar@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add RGBA data parsing for webp and bmp formats
Add WebP/BMP RGBA parsing and APNG format support
Mar 31, 2026
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.
Extends format coverage for pixel-level RGBA extraction and adds APNG as a distinct detected format.
Changes
WebP & BMP RGBA extraction
golang.org/x/image(v0.23.0) as the sole new dependency for WebP and BMP decodingprocessor/rgba.go: extended single-frame handler to coverwebpandbmpvia side-effect imports (_ "golang.org/x/image/webp"/bmp), hooking intoimage.DecodeautomaticallyAPNG format support
processor/type.go): PNG files are now scanned for anacTLchunk; if present, type resolves to"apng"rather than"png"— existing PNG detection is unaffectedprocessor/wh.go):"apng"added to theimage.DecodeConfigbranch alongside PNG/JPG/GIFprocessor/apng.go): new helpersparseAPNGFrames/buildAPNGFramePNG/buildPNGChunkreconstruct a minimal self-contained PNG per frame fromfcTL+IDAT/fdATchunks, then decode each with the standardimage/pngdecoderprocessor/rgba.go): APNG handled analogously to GIF — each frame decoded independently and placed at itsxOffset/yOffsetwithin the canvasTest assets
test/imgs/cool.apng: 4×4 3-frame APNG (red / green / blue frames)test/imgs/go_24.bmp: 24-bit BMP derived fromgo.png(existinggo.bmpis 4-bit, unsupported by the decoder)