mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat(tools): remove background from animated GIFs (WebP, APNG) (#502)
Adds a dedicated remove-gif-background AI tool: removes the background from an animated GIF, WebP, or APNG frame by frame and reassembles a transparent (or composited) animation in WebP, APNG, or GIF, with full per-frame effects. Reuses the background-removal bundle. Verified end-to-end with the real rembg model. Closes #496.
This commit is contained in:
+11
@@ -352,6 +352,17 @@ async function main() {
|
||||
"animated-simpsons.gif",
|
||||
);
|
||||
|
||||
// ── Animated APNG (multi-frame, full alpha) for remove-gif-background ──
|
||||
// The committed file is a 4-frame RGBA APNG. This regenerates a small animated
|
||||
// APNG only if the fixture is missing (bytes will differ from the committed one).
|
||||
console.log("Animated APNG (for remove-gif-background):");
|
||||
const apngOut = join(IMAGE_VALID, "animated.apng");
|
||||
ffIfMissing(
|
||||
apngOut,
|
||||
`-f lavfi -i "testsrc=duration=1:size=48x48:rate=4" -pix_fmt rgba -plays 0 -f apng -y "${apngOut}"`,
|
||||
"animated.apng",
|
||||
);
|
||||
|
||||
// ── Synthetic audio/video (A) ──
|
||||
// NOTE: media-30s.mp4 and media-30s.wav are no longer generated here.
|
||||
// media-30s.mp4 is now a real Big Buck Bunny CC-BY hero clip (committed).
|
||||
|
||||
Reference in New Issue
Block a user