The swiss army knife of lossless video/audio editing
Release announcements: hashtags, less blur, notes from the 3.70.1 posts
Mikael Finstad26102136c54b
diff --git a/AGENTS.md b/AGENTS.mdindex 7f8d0048..f41a3aed 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -34,13 +34,22 @@ After a GitHub release is published, draft one post per channel from `versions/<| Channel | Where | Limit ||---|---|---|-| Discord | the announcements channel of https://discord.gg/fhnEREfUJ3 | 2000 chars |+| Discord | #general of https://discord.gg/fhnEREfUJ3 (there's no announcements channel) | 2000 chars || X | https://x.com/losslesscut (then repost from @mifi_no) | 280 chars || Bluesky | https://bsky.app/profile/losslesscut.app | 300 chars || Mastodon | https://mastodon.social/@losslesscut | 500 chars || Instagram | https://www.instagram.com/losslesscut.app/ (Create → Post on the website) | 2200 chars, links aren't clickable: say "link in bio" |- Start with "LosslessCut x.y.z is out", then the 1–3 most interesting changes for users, then the release link (https://github.com/mifi/lossless-cut/releases/tag/vx.y.z). Discord can take the full list.-- Plain text, no issue references. The link counts toward the limit (on X as 23 chars). A patch release that only fixes one platform can be a single line.+- Plain text, no issue references. The link counts toward the limit (on X and Mastodon as 23 chars). A patch release that only fixes one platform can be a single line.+- Hashtags go at the end, in CamelCase (readable for screen readers), and count toward the limit. They matter most on Mastodon, which has no recommendation algorithm, so people find posts by following hashtags: use 3–4, e.g. `#LosslessCut #FFmpeg #VideoEditing #OpenSource`. Bluesky: 1–2 (`#LosslessCut #OpenSource`). Instagram: 3–5. X: at most `#LosslessCut`. Discord: none.+- Post to all channels by default.- Attach an image made with `node script/releaseImage.ts <version> [--bg photo.jpg] [--position top|bottom|left|right|center] [--caption "..."] [--square] "highlight 1" "highlight 2" "highlight 3"` (1600×900 PNG in `dist/`, or 1080×1080 with `--square`, e.g. for Instagram). Ask the user for a recent photo of theirs to use as the background (optional) and a short caption for it (where/what, shown small in the corner). The photo is cropped to keep its most interesting part; look at the result, and if the subject is cut off (e.g. a portrait photo) or hidden behind the text, try `--position` (top/bottom for a portrait photo, left/right for a wide one). Keep highlights short so they fit on one line. Never commit the photo or the image. Add alt text, e.g. "LosslessCut 3.70.1: <highlights>".+ - Phone photos are often HEIC: convert with `sips -s format jpeg photo.HEIC --out photo.jpg` (sharp can't read HEIC). Files in `~/Downloads` may not be readable from the shell (macOS privacy protection); ask the user to move the photo to the Desktop.+ - `--position` only moves the crop along the axis that gets cut, so a 4:3 photo in the 16:9 image can only move up/down. If the subject still ends up behind the text, crop the photo first (e.g. with sharp's `extract`) so the subject sits in the right half.- Post through the user's logged-in browser. Fill in the post and let the user confirm before clicking Post.+ - The built-in browser can't pick files in the upload dialog: copy the images to the Desktop with clear names (e.g. `losslesscut-3.70.1.png`, `losslesscut-3.70.1-square.png`), click the platform's attach button, and ask the user to pick the file.+ - Bluesky turns a typed URL into a link card and removes it from the text, and an attached image replaces the card. After attaching the image, check that the link is still in the text, and type it again at the end if not.+ - Discord sends on Enter, and typing a long multi-line message into it in the built-in browser drops lines. Put the message on the clipboard with `pbcopy`, ask the user to paste it into the message box with Cmd+V, and check the box before sending.+ - After posting, open the profile and note the post's URL.+ - After the X post, remind the user to repost it from their personal account @mifi_no (it's usually not signed in in the built-in browser, so the user does it). Check the post's reposts list (`/status/<id>/retweets`) to confirm.diff --git a/script/releaseImage.ts b/script/releaseImage.tsindex bf697938..cc0d5297 100644--- a/script/releaseImage.ts+++ b/script/releaseImage.ts@@ -78,9 +78,9 @@ async function getBackground() {// Without a photo, use a dark gradient in the accent huereturn { base: svg(`<defs><linearGradient id="g" x1="0" x2="1" y1="0" y2="1"><stop offset="0" stop-color="hsl(${hue}, 30%, 12%)" /><stop offset="1" stop-color="hsl(${(hue + 40) % 360}, 45%, 28%)" /></linearGradient></defs><rect width="100%" height="100%" fill="url(#g)" />`), layers: [] };}- // Blur only behind the text, fading into the sharp photo- const blurMask = svg(`<defs>${fade('m', [[0, 1], [0.45, 1], [0.7, 0]])}</defs><rect width="100%" height="100%" fill="url(#m)" />`);- const blurred = await sharp(photo).blur(25).composite([{ input: blurMask, blend: 'dest-in' }]).png().toBuffer();+ // Blur only behind the text, lightly, fading into the sharp photo+ const blurMask = svg(`<defs>${fade('m', [[0, 1], [0.35, 1], [0.55, 0]])}</defs><rect width="100%" height="100%" fill="url(#m)" />`);+ const blurred = await sharp(photo).blur(8).composite([{ input: blurMask, blend: 'dest-in' }]).png().toBuffer();return { base: photo, layers: [{ input: blurred }] };}