Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

Float the README preview on a gradient card

Jareer1b8761e75893
diff --git a/README.md b/README.md
index 1c6f8e4b..9f9ed49a 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
<a href="LICENSE"><img src="https://img.shields.io/badge/License-AGPL%20v3-c6f432?style=flat&logo=gnu&logoColor=F8F8F8&labelColor=000000" alt="License: AGPL-3.0-or-later" /></a>
</p>
-<img src="assets/preview-dark.png" alt="Concat editor" width="100%" />
+<img src="assets/preview.png" alt="Concat editor" width="100%" />
</div>
diff --git a/assets/preview.png b/assets/preview.png
new file mode 100644
index 00000000..f866e5ca
Binary files /dev/null and b/assets/preview.png differ
diff --git a/assets/preview-dark.png b/assets/screenshot-dark.png
similarity index 100%
rename from assets/preview-dark.png
rename to assets/screenshot-dark.png
diff --git a/assets/screenshot-light.png b/assets/screenshot-light.png
deleted file mode 100644
index 980c3549..00000000
Binary files a/assets/screenshot-light.png and /dev/null differ
diff --git a/scripts/editor-preview-sop.md b/scripts/editor-preview-sop.md
index 01e36516..39d05bc6 100644
--- a/scripts/editor-preview-sop.md
+++ b/scripts/editor-preview-sop.md
@@ -1,41 +1,35 @@
-# SOP: updating the README hero screenshot
+# SOP: updating the README hero image
-The image at the top of `README.md` is `assets/editor-preview.png` — a single
-frame that is the **dark theme on the left half** and the **light theme on the
-right half**, joined at the vertical center line. Because both screenshots show
-the identical window state, the seam falls invisibly through the middle of the
-preview pane.
+The image at the top of `README.md` is `assets/preview.png`: the dark-theme
+editor window floating on a soft gradient card, built by
+`scripts/make-preview.py` from the raw capture in `assets/screenshot-dark.png`.
## Steps
-1. **Run the app** — `cd engine && cargo run --release -p concat`. Stage something presentable:
- a clip in the media bin, a couple of tracks on the timeline, the playhead
- somewhere interesting. Avoid personal file names in the media panel.
+1. **Run the app** — `cd engine && cargo run --release -p concat`. Stage something
+ presentable: clips in the media bin, a few tracks on the timeline, the
+ playhead somewhere interesting. Avoid personal file names in the media
+ panel. Make the window wide (the composite assumes a landscape window).
-2. **Take the dark screenshot.** With the app in dark theme, press
- `⌘⇧4`, then `Space`, then click the Concat window (captures just the
- window). Don't move or resize the window after this.
+2. **Capture the window.** In dark theme, press `⌘⇧4`, then `Space`, then
+ click the Concat window. macOS saves the window with a transparent margin
+ and its drop shadow; the script trims that away itself.
-3. **Switch to light theme** (the sun/moon toggle in the title bar) and take
- the second screenshot the same way. **Don't touch anything else** — same
- window size, same panels, same playhead. Any drift shows at the seam.
-
-4. **Build the split:**
+3. **Build the composite:**
```sh
- scripts/make-editor-preview.sh ~/Desktop/Screenshot*<time1>*.png ~/Desktop/Screenshot*<time2>*.png
+ cp ~/Desktop/Screenshot*<time>*.png assets/screenshot-dark.png
+ scripts/make-preview.py
```
- First argument is the **dark** screenshot, second is the **light** one.
- Tab-complete or glob the paths — macOS puts a narrow no-break space before
- "AM"/"PM" in screenshot names, so a hand-typed regular space won't match.
-
- The script verifies both images are the same size, copies them to
- `assets/screenshot-dark.png` / `assets/screenshot-light.png`, and writes
- `assets/editor-preview.png`.
+ Tab-complete or glob the screenshot path: macOS puts a narrow no-break
+ space before "AM"/"PM" in the file name. The script needs Pillow
+ (`pip install pillow`). Pass explicit paths to build from somewhere else:
+ `scripts/make-preview.py in.png out.png`.
-5. **Check the result** — open `assets/editor-preview.png` and look at the
- center seam. If panels are misaligned, retake both screenshots.
+4. **Check the result** — open `assets/preview.png`. The window should sit
+ centred with the timeline running off the bottom edge. Backdrop colours,
+ corner radii, and the crop height are constants at the top of the script.
-6. **Commit** the three changed files in `assets/`. The README references
- `assets/editor-preview.png` by path, so no README edit is needed.
+5. **Commit** `assets/screenshot-dark.png` and `assets/preview.png`. The
+ README references `assets/preview.png` by path, so no README edit is needed.
diff --git a/scripts/make-editor-preview.sh b/scripts/make-editor-preview.sh
deleted file mode 100755
index 14e8b17d..00000000
--- a/scripts/make-editor-preview.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env bash
-# Build the README hero image: left half dark theme, right half light theme.
-#
-# Usage:
-# scripts/make-editor-preview.sh <dark-screenshot.png> <light-screenshot.png>
-#
-# Writes into assets/:
-# screenshot-dark.png copy of the dark-theme screenshot
-# screenshot-light.png copy of the light-theme screenshot
-# editor-preview.png the split image referenced by README.md
-#
-# Both screenshots must be the same size, taken of the same window state,
-# so the seam lands cleanly. Needs ffmpeg on PATH.
-set -euo pipefail
-
-REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
-OUT="$REPO_ROOT/assets"
-
-if [[ $# -ne 2 ]]; then
- echo "usage: $0 <dark-screenshot.png> <light-screenshot.png>" >&2
- exit 1
-fi
-DARK="$1"
-LIGHT="$2"
-
-for f in "$DARK" "$LIGHT"; do
- if [[ ! -f "$f" ]]; then
- echo "error: not found: $f" >&2
- echo "hint: macOS screenshot names contain a narrow no-break space before AM/PM;" >&2
- echo " tab-complete the path or use a glob like ~/Desktop/Screenshot*5.28.18*.png" >&2
- exit 1
- fi
-done
-
-command -v ffmpeg >/dev/null 2>&1 || { echo "error: ffmpeg not on PATH" >&2; exit 1; }
-
-dims() { ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 "$1"; }
-d1="$(dims "$DARK")"; d2="$(dims "$LIGHT")"
-if [[ "$d1" != "$d2" ]]; then
- echo "error: size mismatch — dark is ${d1}, light is ${d2}; retake so both match" >&2
- exit 1
-fi
-
-cp "$DARK" "$OUT/screenshot-dark.png"
-cp "$LIGHT" "$OUT/screenshot-light.png"
-
-ffmpeg -y -v error \
- -i "$OUT/screenshot-dark.png" -i "$OUT/screenshot-light.png" \
- -filter_complex "[0:v]crop=iw/2:ih:0:0[left];[1:v]crop=iw/2:ih:iw/2:0[right];[left][right]hstack" \
- -frames:v 1 "$OUT/editor-preview.png"
-
-echo "wrote $OUT/screenshot-dark.png"
-echo "wrote $OUT/screenshot-light.png"
-echo "wrote $OUT/editor-preview.png (${d1%,*}x${d1#*,})"
diff --git a/scripts/make-preview.py b/scripts/make-preview.py
new file mode 100755
index 00000000..ebd2a1bf
--- /dev/null
+++ b/scripts/make-preview.py
@@ -0,0 +1,108 @@
+#!/usr/bin/env python3
+"""Build the README hero image from a window screenshot.
+
+Usage:
+ scripts/make-preview.py [screenshot.png] [out.png]
+
+Defaults to assets/screenshot-dark.png -> assets/preview.png.
+
+Takes a macOS window capture (Cmd-Shift-4, Space, click the window: the PNG
+has a transparent margin with the window's drop shadow in it), trims it to
+the solid window, rounds the corners, and floats it with a soft shadow on a
+muted gradient backdrop. The bottom of the window runs off the frame so the
+timeline reads as continuing below the fold. Needs Pillow.
+"""
+import sys
+from pathlib import Path
+
+from PIL import Image, ImageDraw, ImageFilter
+
+ROOT = Path(__file__).resolve().parent.parent
+SRC = Path(sys.argv[1]) if len(sys.argv) > 1 else ROOT / "assets" / "screenshot-dark.png"
+OUT = Path(sys.argv[2]) if len(sys.argv) > 2 else ROOT / "assets" / "preview.png"
+
+CANVAS_W = 3200
+CANVAS_H = 1780
+WINDOW_FRACTION = 0.92 # window width as a share of the canvas width
+WINDOW_TOP = 136
+WINDOW_RADIUS = 26
+CARD_RADIUS = 56
+SHADOW_BLUR = 70
+SHADOW_OFFSET = 44
+SHADOW_ALPHA = 150
+
+
+def solid_bbox(im: Image.Image):
+ """Bounds of the fully opaque window, ignoring the capture's soft shadow."""
+ alpha = im.getchannel("A")
+ return alpha.point(lambda v: 255 if v > 250 else 0).getbbox()
+
+
+def rounded_mask(size, radius):
+ mask = Image.new("L", size, 0)
+ ImageDraw.Draw(mask).rounded_rectangle((0, 0, size[0] - 1, size[1] - 1), radius, fill=255)
+ return mask
+
+
+def backdrop(size):
+ """Soft, slightly moody gradient: painted at low resolution, then blown up."""
+ w, h = size
+ small = (200, round(200 * h / w))
+ bg = Image.new("RGB", small, (158, 160, 180))
+ d = ImageDraw.Draw(bg)
+ sw, sh = small
+ blobs = [
+ # (cx, cy, rx, ry, colour) as fractions of the small canvas
+ (0.12, 0.10, 0.45, 0.40, (210, 209, 224)),
+ (0.55, 0.05, 0.42, 0.34, (78, 80, 96)),
+ (0.95, 0.20, 0.30, 0.45, (200, 200, 216)),
+ (0.30, 0.95, 0.55, 0.32, (218, 217, 228)),
+ (0.85, 0.95, 0.40, 0.32, (226, 225, 234)),
+ (0.02, 0.60, 0.22, 0.35, (126, 128, 150)),
+ ]
+ for cx, cy, rx, ry, colour in blobs:
+ d.ellipse(
+ (sw * (cx - rx), sh * (cy - ry), sw * (cx + rx), sh * (cy + ry)),
+ fill=colour,
+ )
+ bg = bg.filter(ImageFilter.GaussianBlur(28))
+ return bg.resize(size, Image.BICUBIC).convert("RGBA")
+
+
+def main():
+ shot = Image.open(SRC).convert("RGBA")
+ box = solid_bbox(shot)
+ if box is None:
+ sys.exit(f"{SRC}: no opaque region found")
+ window = shot.crop(box)
+
+ target_w = round(CANVAS_W * WINDOW_FRACTION)
+ if window.width != target_w:
+ window = window.resize(
+ (target_w, round(window.height * target_w / window.width)), Image.LANCZOS
+ )
+ window.putalpha(rounded_mask(window.size, WINDOW_RADIUS))
+
+ canvas = backdrop((CANVAS_W, CANVAS_H))
+ x = (CANVAS_W - window.width) // 2
+ y = WINDOW_TOP
+
+ pad = SHADOW_BLUR * 3
+ shadow = Image.new("RGBA", (window.width + 2 * pad, window.height + 2 * pad), (0, 0, 0, 0))
+ ImageDraw.Draw(shadow).rounded_rectangle(
+ (pad, pad, pad + window.width - 1, pad + window.height - 1),
+ WINDOW_RADIUS,
+ fill=(0, 0, 0, SHADOW_ALPHA),
+ )
+ shadow = shadow.filter(ImageFilter.GaussianBlur(SHADOW_BLUR))
+ canvas.alpha_composite(shadow, (x - pad, y - pad + SHADOW_OFFSET))
+ canvas.alpha_composite(window, (x, y))
+
+ canvas.putalpha(rounded_mask(canvas.size, CARD_RADIUS))
+ OUT.parent.mkdir(parents=True, exist_ok=True)
+ canvas.save(OUT, optimize=True)
+ print(f"wrote {OUT} ({canvas.width}x{canvas.height})")
+
+
+if __name__ == "__main__":
+ main()