Demo crop comparison — vcspull sync¶
Dead-space crop approaches applied to vcspull-sync.gif
(original 1175×202, 76K). The static empty area is mostly horizontal
— the text fills only ~354px of the 1175px terminal width — plus ~49px of
vertical slack. Generated by a /spike:bakeoff.
Original — 1175×202 · 76K¶
A · ffmpeg cropdetect (black mode) — ❌ no crop¶
1174×202 · 68K. The terminal background (#282A36 Dracula, luminance
~43) sits above cropdetect’s black threshold (24), so the whole frame
reads as content and only 1px is shaved. Raising limit past the bg
luminance returned no stable box.
B · ImageMagick -layers TrimBounds — ❌ no crop + 5× bloat¶
1175×202 · 360K. TrimBounds trims layer canvas bounds, but agg
renders each frame full-size, so the union of bounds is the full frame.
Coalescing also unoptimised the file to 360K.
C · ffmpeg cropdetect=mode=mvedges — ❌ no motion vectors¶
GIF frames are intra-coded; re-encoding to H.264 yielded no usable motion vectors, so the motion-based detector had nothing to work from.
D · ImageMagick union-trim (full crop) — ✅ 375×173 · 72K¶
-coalesce → clone/flatten → -fuzz 4% -trim → viewport crop → give 10px
of the terminal’s own background on all sides → -layers Optimize. The
padding colour is sampled from the gif (#282A36, Dracula — not
Catppuccin), so it’s seamless: the corner pixel is bit-identical to the
terminal bg, extending the terminal’s margin rather than framing it.
E · Vertical-only crop (keep terminal width) — ✅ 1175×181 · 68K¶
ffmpeg crop=1175:181:0:1 — trims only the vertical slack, preserving the
full terminal width so it still reads as a terminal.
Verdict¶
# |
approach |
result |
dead space removed |
verdict |
|---|---|---|---|---|
A |
ffmpeg cropdetect (black) |
1174×202 |
~0% |
❌ bg above threshold |
B |
ImageMagick TrimBounds |
1175×202, 360K |
0% |
❌ + bloat |
C |
ffmpeg cropdetect mvedges |
— |
— |
❌ no motion vectors |
D |
ImageMagick union-trim |
375×173 |
~69% |
✅ recommended |
E |
vertical-only ffmpeg crop |
1175×181 |
~10% (vertical) |
✅ keeps terminal look |
The only reliable spatial cropper for a terminal GIF is the ImageMagick
union-trim recipe (D) — cropdetect/TrimBounds/mvedges all failed on
non-black, full-frame content. Choose D for a compact demo or E to
keep the terminal framing; either way, re-render from the source at the
right size is cheaper still.