Skip to content

v1.13.0 β€” On-device compositor + GIF export πŸ“½οΈ

Choose a tag to compare

@ozgesolidkey ozgesolidkey released this 30 Sep 20:59
· 10 commits to main since this release

On-device compositor + GIF export β€” the flagship "2.0" πŸ“½οΈ

KMPMedia could put one piece of media in one shape. 1.13.0 adds Bet 3: compose several layers on one timeline, animate them with keyframes, preview the result live at 60fps, and export it to a shareable animated GIF β€” all authored on device. No other KMP library does compose-and-export.

Added

  • OGComposition β€” a fixed width Γ— height canvas, a durationMs timeline at fps, a background colour, and a back-to-front stack of OGCompositionLayers. Each layer is a still image or a solid fill, placed in a box whose x / y / scale / rotation / opacity are each an animatable keyframe track, optionally clipped to any KMPMedia shape (built-in, lasso, multi-region, CircleShape, …), visible over [startMs, endMs].
  • OGCompositionView β€” plays the composition on the Compose frame clock (holds 60fps, no intermediate bitmap) or acts as a scrubber via positionMs.
  • OGComposition.exportGif() β€” renders every frame offscreen and encodes one looping animated GIF with the built-in pure-Kotlin OGGifEncoder (median-cut palette + LZW) β€” no dependency, no platform encoder, identical bytes on Android and iOS. Returns the ByteArray; where to save/share is the app's call. renderFrame(timeMs) grabs any single frame.
  • OGKeyframedFloat / OGKeyframe / OGEasing β€” an animatable float track (LINEAR / EASE_IN / EASE_OUT / EASE_IN_OUT), parse-nothing / lerp-per-frame.
  • OGGifEncoder β€” a standalone, dependency-free GIF89a encoder usable on its own for any frame list.

Everything is pure commonMain and purely additive (new com.solidkey.painpoints.compositor package, nothing existing changed). 19 tests green on JVM + iOS. See docs/COMPOSITOR.md. MP4 / frame-sequence export are the planned follow-ups.

implementation("se.solidkey:kmpmedia-lib:1.13.0")