v1.13.0 β On-device compositor + GIF export π½οΈ
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 fixedwidthΓheightcanvas, adurationMstimeline atfps, a background colour, and a back-to-front stack ofOGCompositionLayers. 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 viapositionMs.OGComposition.exportGif()β renders every frame offscreen and encodes one looping animated GIF with the built-in pure-KotlinOGGifEncoder(median-cut palette + LZW) β no dependency, no platform encoder, identical bytes on Android and iOS. Returns theByteArray; 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")