Skip to content

Add WebP codec module with FFM-based platform backends and bundled ar…#13

Merged
dima-dencep merged 22 commits intomainfrom
webp
Mar 9, 2026
Merged

Add WebP codec module with FFM-based platform backends and bundled ar…#13
dima-dencep merged 22 commits intomainfrom
webp

Conversation

@dima-dencep
Copy link
Member

…tifact

New webp module providing WebP encode/decode via Java 25 FFM API:

  • libwebp backend (cross-platform, if library available)
  • macOS ImageIO (CoreGraphics) backend
  • Windows WIC backend
  • Java ImageIO fallback (works with TwelveMonkeys plugin)
  • Bundled artifact with shaded+ProGuard-optimized TwelveMonkeys (~146K)
  • Testing UI with backend probing, encode/decode tests, and file preview
  • Updated README with WebP documentation and usage examples

dima-dencep and others added 17 commits March 9, 2026 21:52
…tifact

New `webp` module providing WebP encode/decode via Java 25 FFM API:
- libwebp backend (cross-platform, if library available)
- macOS ImageIO (CoreGraphics) backend
- Windows WIC backend
- Java ImageIO fallback (works with TwelveMonkeys plugin)
- Bundled artifact with shaded+ProGuard-optimized TwelveMonkeys (~146K)
- Testing UI with backend probing, encode/decode tests, and file preview
- Updated README with WebP documentation and usage examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix CoInitializeEx invokeExact return type mismatch (WrongMethodTypeException)
- Add libwebp-7 to library search names (MinGW/MSYS2 SONAME convention)
- Configure testing module with shadow fat JAR and Main-Class manifest
- Use ProGuard-optimized bundled webp artifact in testing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch all encoder/decoder backends from byte[] RGBA to int[] ARGB —
the native Java2D pixel format. This eliminates all manual byte-level
pixel conversion and enables trivial interop with BufferedImage.

- Extract DecodedImage from inner record to standalone class with
  toPng(), fromPng(), and isPngCached() methods (PNG caching)
- Add isWebP() detection to PlatformWebPDecoder with backend overrides
- libwebp: use WebPDecodeARGB/WebPEncode*BGRA (int[] ARGB = BGRA on LE)
- macOS: use kCGBitmapByteOrder32Little|kCGImageAlphaFirst for encoding
- Windows WIC: use GUID_WICPixelFormat32bppBGRA (native int[] = ARGB)
- Java ImageIO: use getRGB()/setRGB() directly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d test suite

- Replace buggy TwelveMonkeys VP8 decoder (43% pixel errors, issue #785) with
  ngengine image-webp-java pure Java WebP decoder - pixel-exact on all test images
- Add 9 diverse test images (gradients, alpha, noise, checkerboard, solid, tall/wide)
  with libwebp reference PNGs for pixel-exact verification
- Parameterize all backend tests (NgEngineDecoderTest, MacOSImageIOTest,
  WindowsWICTest, CrossBackendTest) over the full image set
- Fix macOS ImageIO decoder bug: handle kCGImageAlphaNoneSkipLast (RGBX) format
  for opaque WebP images
- Add NgEngineDecoder to CrossBackendTest for cross-backend pixel comparison
- Remove JavaImageIODecoder, JavaImageIOEncoder and related ImageIO SPI config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dima-dencep dima-dencep marked this pull request as ready for review March 9, 2026 20:04
@dima-dencep dima-dencep merged commit d6e07d1 into main Mar 9, 2026
4 checks passed
@dima-dencep dima-dencep deleted the webp branch March 9, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant