Skip to content

JimLiu/baocut / skills/baocut

baocut

Flagged

用 BaoCut 处理视频与音频:转录、字幕、翻译、配音、剪口播、切短视频、分章、总结写稿、从链接下载、压缩转码、导出成片,或从零做一条成片。有媒体文件、视频链接、字幕文件或 BaoCut 视频时用;只翻译纯文本、与视频无关的写作或作图、别的剪辑器与 FFmpeg 的用法、BaoCut 源码开发不用。

FileKindSize
SKILL.mdskill md46.5 KB
built-in-skills/README.mdmarkdown9.6 KB
references/catalog/editing.mdmarkdown24.4 KB
references/catalog/export.mdmarkdown6.6 KB
references/catalog/media.mdmarkdown45.1 KB
references/catalog/models.mdmarkdown7.9 KB
references/catalog/music.mdmarkdown17.1 KB
references/catalog/subtitles.mdmarkdown20.8 KB
references/catalog/system.mdmarkdown9.6 KB
references/catalog/voice-gemini-tts.mdmarkdown2.6 KB
references/catalog/voice-language-rates.mdmarkdown6.5 KB
references/catalog/voice.mdmarkdown12.3 KB
references/catalog/web.mdmarkdown10.9 KB
references/conventions.mdmarkdown16.1 KB
references/craft/.gitkeepother0 B
references/craft/README.mdmarkdown480 B
references/craft/character-animation.mdmarkdown6.8 KB
references/craft/character-animation/examples/mini-film/art.example.jsonconfig918 B
references/craft/character-animation/examples/mini-film/index.htmlother628 B
references/craft/character-animation/examples/mini-film/scene.jsscript2.1 KB
references/craft/character-animation/references/art.mdmarkdown4.6 KB
references/craft/character-animation/references/checks.mdmarkdown2.6 KB
references/craft/character-animation/references/rig.mdmarkdown5.3 KB
references/craft/character-animation/references/style-and-story.mdmarkdown5.0 KB
references/craft/character-animation/references/timing-and-sound.mdmarkdown3.1 KB
references/craft/character-animation/rig-kit/rig-kit.jsscript33.0 KB
references/craft/character-animation/scripts/cutout.mjsscript26.9 KB
references/craft/character-animation/scripts/jump-scan.mjsscript3.2 KB
references/craft/character-animation/scripts/place-sfx.mjsscript5.1 KB
references/craft/character-animation/scripts/rig-check.mjsscript8.9 KB
references/craft/clip-montage.mdmarkdown11.5 KB
references/craft/clip-montage/references/assembly.mdmarkdown5.0 KB
references/craft/clip-montage/references/sourcing.mdmarkdown6.3 KB
references/craft/clip-montage/references/structure.mdmarkdown3.8 KB
references/craft/cover-and-title.mdmarkdown5.6 KB
references/craft/cross-video-qa.mdmarkdown5.8 KB
references/craft/design-system.mdmarkdown18.5 KB
references/craft/design-system/references/cover.mdmarkdown6.9 KB
references/craft/design-system/references/craft.mdmarkdown8.8 KB
references/craft/design-system/references/demo.jsonconfig161.1 KB
references/craft/design-system/references/format.mdmarkdown18.6 KB
references/craft/design-system/references/from-code.mdmarkdown11.5 KB
references/craft/design-system/references/from-design-tool.mdmarkdown16.2 KB
references/craft/design-system/references/sample-seazar-tokens.jsonconfig11.0 KB
references/craft/design.mdmarkdown19.3 KB
references/craft/design/references/brand-colors.mdmarkdown2.4 KB
references/craft/design/references/brand-typography.mdmarkdown1.7 KB
references/craft/design/references/craft.mdmarkdown15.4 KB
references/craft/design/references/design-system-components.mdmarkdown11.8 KB
references/craft/design/references/diagrams.mdmarkdown10.1 KB
references/craft/design/references/format.mdmarkdown11.8 KB
references/craft/design/references/print.mdmarkdown5.6 KB
references/craft/design/references/questions.mdmarkdown4.7 KB
references/craft/design/references/view-state.mdmarkdown5.7 KB
references/craft/docs.mdmarkdown19.9 KB
references/craft/docs/references/comments.mdmarkdown4.4 KB
references/craft/docs/references/editing.mdmarkdown12.9 KB
references/craft/docs/references/tabs.mdmarkdown4.7 KB
references/craft/docs/references/uploads.mdmarkdown1.7 KB
references/craft/explainer-video.mdmarkdown23.4 KB
references/craft/explainer-video/references/3d.mdmarkdown5.9 KB
references/craft/explainer-video/references/footage.mdmarkdown9.6 KB
references/craft/explainer-video/references/length-and-pace.mdmarkdown6.7 KB
references/craft/explainer-video/references/script.mdmarkdown14.7 KB
references/craft/explainer-video/references/subject.mdmarkdown12.5 KB
references/craft/history-video.mdmarkdown20.6 KB
references/craft/history-video/references/brief.mdmarkdown5.1 KB
references/craft/history-video/references/forms.mdmarkdown11.2 KB
references/craft/history-video/references/old-recordings.mdmarkdown12.4 KB
references/craft/history-video/references/self-check.mdmarkdown5.3 KB
references/craft/history-video/references/sources.mdmarkdown5.9 KB
references/craft/motion-graphics.mdmarkdown17.3 KB
references/craft/motion-graphics/exemplars/big-number/16x9.htmlother11.4 KB
references/craft/motion-graphics/exemplars/big-number/9x16.htmlother11.5 KB
references/craft/motion-graphics/exemplars/callout-pin/16x9.htmlother11.6 KB
references/craft/motion-graphics/exemplars/callout-pin/9x16.htmlother11.6 KB
references/craft/motion-graphics/exemplars/keyword-caption/16x9.htmlother11.3 KB
references/craft/motion-graphics/exemplars/keyword-caption/9x16.htmlother11.3 KB
references/craft/motion-graphics/exemplars/logo-sting/16x9.htmlother12.1 KB
references/craft/motion-graphics/exemplars/logo-sting/9x16.htmlother12.1 KB
references/craft/motion-graphics/exemplars/lower-third/16x9.htmlother11.2 KB
references/craft/motion-graphics/exemplars/lower-third/9x16.htmlother11.2 KB
references/craft/motion-graphics/references/audio-backdrop.mdmarkdown22.9 KB
references/craft/motion-graphics/references/grammar.mdmarkdown11.1 KB
references/craft/motion-graphics/scaffold.htmlother9.0 KB
references/craft/motion-graphics/scripts/build-bundle.mjsscript25.2 KB
references/craft/narration.mdmarkdown11.1 KB
references/craft/polish-transcript.mdmarkdown13.8 KB
references/craft/production-scripts.mdmarkdown15.7 KB
references/craft/production-scripts/references/pipeline.mdmarkdown37.8 KB
references/craft/production-scripts/scene-kit/geo110.jsscript27.3 KB
references/craft/production-scripts/scene-kit/scene-kit.jsscript38.3 KB
references/craft/production-scripts/scripts/align.mjsscript11.6 KB
references/craft/production-scripts/scripts/assemble.mjsscript26.4 KB
references/craft/production-scripts/scripts/build.mjsscript18.1 KB
references/craft/production-scripts/scripts/captions.mjsscript18.6 KB
references/craft/production-scripts/scripts/clips.example.jsonconfig3.2 KB
references/craft/production-scripts/scripts/coverage.mjsscript10.0 KB
references/craft/production-scripts/scripts/envelope.mjsscript2.9 KB
references/craft/production-scripts/scripts/explainer.example.jsonconfig2.2 KB
references/craft/production-scripts/scripts/fonts.mjsscript7.0 KB
references/craft/production-scripts/scripts/frames.mjsscript7.7 KB
references/craft/production-scripts/scripts/gaps.mjsscript11.3 KB
references/craft/production-scripts/scripts/host.mjsscript14.8 KB
references/craft/production-scripts/scripts/legibility.mjsscript5.7 KB
references/craft/production-scripts/scripts/level.mjsscript9.2 KB
references/craft/production-scripts/scripts/lib.mjsscript19.3 KB
references/craft/production-scripts/scripts/overlay.mjsscript34.7 KB
references/craft/production-scripts/scripts/preview.mjsscript4.6 KB
references/craft/production-scripts/scripts/quotes.mjsscript7.4 KB
references/craft/production-scripts/scripts/sources.mjsscript6.2 KB
references/craft/production-scripts/scripts/srt.mjsscript5.8 KB
references/craft/production-scripts/scripts/voice.mjsscript7.7 KB
references/craft/shorts-segments.mdmarkdown30.8 KB
references/craft/slides.mdmarkdown13.8 KB
references/craft/slides/references/design-system.mdmarkdown6.3 KB
references/craft/slides/references/design.mdmarkdown9.3 KB
references/craft/slides/references/format.mdmarkdown12.2 KB
references/craft/slides/references/images.mdmarkdown4.2 KB
references/craft/speaker-labeling.mdmarkdown6.6 KB
references/craft/subtitle-workflow.mdmarkdown13.1 KB
references/craft/talking-head-cut.mdmarkdown9.3 KB
references/craft/talking-head-cut/references/picture-and-sound.mdmarkdown10.1 KB
references/craft/titles-and-description.mdmarkdown5.2 KB
references/craft/titles-and-description/references/description.mdmarkdown5.1 KB
references/craft/titles-and-description/references/titles.mdmarkdown5.5 KB
references/craft/titles-and-description/references/writing-baseline.mdmarkdown11.9 KB
references/craft/translate-subtitles.mdmarkdown13.4 KB
references/craft/video-blog.mdmarkdown17.1 KB
references/craft/video-blog/references/writing-baseline.mdmarkdown11.9 KB
references/craft/video-chapters.mdmarkdown9.7 KB
references/craft/video-production.mdmarkdown31.9 KB
references/craft/video-production/examples/bundle-preview.htmlother17.7 KB
references/craft/video-production/examples/post-fx.jsscript7.5 KB
references/craft/video-production/references/code-scenes.mdmarkdown31.9 KB
references/craft/video-production/references/shot-plan.mdmarkdown5.1 KB
references/craft/video-production/references/sound-design.mdmarkdown4.4 KB
references/craft/video-production/references/visuals.mdmarkdown19.7 KB
references/craft/video-summary.mdmarkdown22.8 KB
references/craft/video-summary/references/writing-baseline.mdmarkdown11.9 KB
references/craft/virtual-host.mdmarkdown14.9 KB
references/craft/virtual-host/examples/character-partmap.example.jsonconfig600 B
references/craft/virtual-host/examples/character.example.jsonconfig336 B
references/craft/virtual-host/references/art.mdmarkdown22.1 KB
references/craft/virtual-host/references/hosts.mdmarkdown4.4 KB
references/craft/virtual-host/references/lipsync.mdmarkdown10.1 KB
references/craft/virtual-host/scripts/lipsync.mjsscript39.8 KB
references/craft/virtual-host/scripts/pinyin-table.mjsscript83.2 KB
references/craft/virtual-host/scripts/puppet-build.mjsscript48.6 KB
references/craft/virtual-host/scripts/puppet-mask.mjsscript3.0 KB
references/craft/virtual-host/scripts/puppet/align.mjsscript4.1 KB
references/craft/virtual-host/scripts/puppet/brows.mjsscript17.2 KB
references/craft/virtual-host/scripts/puppet/edits.mjsscript4.3 KB
references/craft/virtual-host/scripts/puppet/expression-labels.jsonconfig1.1 KB
references/craft/virtual-host/scripts/puppet/expreyes.mjsscript35.9 KB
references/craft/virtual-host/scripts/puppet/eyes.mjsscript8.6 KB
references/craft/virtual-host/scripts/puppet/fill.mjsscript10.5 KB
references/craft/virtual-host/scripts/puppet/layers.mjsscript5.7 KB
references/craft/virtual-host/scripts/puppet/mapbuild.mjsscript50.4 KB
references/craft/virtual-host/scripts/puppet/ops.mjsscript7.4 KB
references/craft/virtual-host/scripts/puppet/pack.mjsscript10.2 KB
references/craft/virtual-host/scripts/puppet/partmap.mjsscript8.5 KB
references/craft/virtual-host/scripts/puppet/parts.mjsscript7.0 KB
references/craft/virtual-host/scripts/puppet/png.mjsscript5.8 KB
references/craft/virtual-host/scripts/puppet/seg.mjsscript21.6 KB
references/craft/virtual-host/scripts/puppet/segment.mjsscript26.6 KB
references/craft/virtual-host/scripts/puppet/zip.mjsscript2.0 KB
references/craft/virtual-host/scripts/visemes.mjsscript21.4 KB
references/craft/vlog-from-clips.mdmarkdown13.2 KB
references/craft/vlog-from-clips/references/footage-log.mdmarkdown3.3 KB
references/mcp.mdmarkdown8.9 KB
references/start.mdmarkdown6.3 KB
references/workflows.mdmarkdown29.8 KB

references/craft/virtual-host/scripts/puppet/fill.mjs

View on GitHub
// i18n-ignore-file: 给智能体拷走用的独立脚本,日志与报错写英文
// Smooth hole filling for soft-shaded art: what is under a removed part (an iris, a mouth, a brow) is painted from the
// colours round it, smooth like a gradient, so moving the part never shows a flat patch or a hard seam.
import { blur } from './ops.mjs';

/**
 * Fill the pixels of `hole` in `im` (RGBA, changed in place) from the pixels of `known`: a push-pull pyramid gives
 * every hole pixel the mean colour of the known pixels round it at the right scale, then a few Jacobi passes smooth the
 * steps. Pixels in neither mask are left as they are. Alpha in the hole becomes 255.
 */
export function smoothFill(im, hole, known, w, h, o = {}) {
  const iters = o.iters ?? 40;
  // work only on the hole's box, padded so its rim's known pixels are inside
  let x0 = w, y0 = h, x1 = -1, y1 = -1;
  for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) if (hole[y * w + x]) { if (x < x0) x0 = x; if (x > x1) x1 = x; if (y < y0) y0 = y; if (y > y1) y1 = y; }
  if (x1 < 0) return im;
  const pad = Math.max(16, Math.round(0.5 * Math.max(x1 - x0, y1 - y0)));
  x0 = Math.max(0, x0 - pad); y0 = Math.max(0, y0 - pad); x1 = Math.min(w - 1, x1 + pad); y1 = Math.min(h - 1, y1 + pad);
  const bw = x1 - x0 + 1, bh = y1 - y0 + 1;
  // level 0: known colours with weight 1
  let lw = bw, lh = bh;
  let C = new Float32Array(bw * bh * 3), Wt = new Float32Array(bw * bh);
  for (let y = 0; y < bh; y++) for (let x = 0; x < bw; x++) {
    const p = (y + y0) * w + x + x0, q = y * bw + x;
    if (!known[p] || hole[p]) continue;
    Wt[q] = 1; C[3 * q] = im.d[4 * p]; C[3 * q + 1] = im.d[4 * p + 1]; C[3 * q + 2] = im.d[4 * p + 2];
  }
  const levels = [{ C, Wt, lw, lh }];
  while (lw > 1 || lh > 1) {
    const nw = Math.max(1, Math.ceil(lw / 2)), nh = Math.max(1, Math.ceil(lh / 2));
    const nC = new Float32Array(nw * nh * 3), nW = new Float32Array(nw * nh);
    for (let y = 0; y < lh; y++) for (let x = 0; x < lw; x++) {
      const q = y * lw + x, t = (y >> 1) * nw + (x >> 1);
      nW[t] += Wt[q]; nC[3 * t] += C[3 * q]; nC[3 * t + 1] += C[3 * q + 1]; nC[3 * t + 2] += C[3 * q + 2];
    }
    C = nC; Wt = nW; lw = nw; lh = nh;
    levels.push({ C, Wt, lw, lh });
    if (levels.length > 20) break;
  }
  // normalise every level to colours (weight > 0), then pull: an empty pixel takes its parent's colour, bilinear
  for (const L of levels) for (let q = 0; q < L.lw * L.lh; q++) if (L.Wt[q] > 0) for (let k = 0; k < 3; k++) L.C[3 * q + k] /= L.Wt[q];
  for (let i = levels.length - 2; i >= 0; i--) {
    const L = levels[i], U = levels[i + 1];
    for (let y = 0; y < L.lh; y++) for (let x = 0; x < L.lw; x++) {
      const q = y * L.lw + x;
      if (L.Wt[q] > 0) continue;
      const fx = Math.min(U.lw - 1, Math.max(0, (x - 0.5) / 2)), fy = Math.min(U.lh - 1, Math.max(0, (y - 0.5) / 2));
      const ax = Math.floor(fx), ay = Math.floor(fy), bx = Math.min(U.lw - 1, ax + 1), by = Math.min(U.lh - 1, ay + 1);
      const tx = fx - ax, ty = fy - ay;
      for (let k = 0; k < 3; k++) {
        const c00 = U.C[3 * (ay * U.lw + ax) + k], c10 = U.C[3 * (ay * U.lw + bx) + k];
        const c01 = U.C[3 * (by * U.lw + ax) + k], c11 = U.C[3 * (by * U.lw + bx) + k];
        L.C[3 * q + k] = (c00 * (1 - tx) + c10 * tx) * (1 - ty) + (c01 * (1 - tx) + c11 * tx) * ty;
      }
      L.Wt[q] = 1e-6; // filled
    }
  }
  // relax the hole: each hole pixel becomes the mean of its four neighbours (known ones fixed)
  const F = levels[0].C, isHole = new Uint8Array(bw * bh);
  for (let y = 0; y < bh; y++) for (let x = 0; x < bw; x++) if (hole[(y + y0) * w + x + x0]) isHole[y * bw + x] = 1;
  const tmp = new Float32Array(F.length);
  for (let it = 0; it < iters; it++) {
    tmp.set(F);
    for (let y = 0; y < bh; y++) for (let x = 0; x < bw; x++) {
      const q = y * bw + x;
      if (!isHole[q]) continue;
      let n = 0; const s = [0, 0, 0];
      for (const [dx, dy] of [[1, 0], [-1, 0], [0, 1], [0, -1]]) {
        const X = x + dx, Y = y + dy;
        if (X < 0 || Y < 0 || X >= bw || Y >= bh) continue;
        const r = Y * bw + X; n++;
        s[0] += tmp[3 * r]; s[1] += tmp[3 * r + 1]; s[2] += tmp[3 * r + 2];
      }
      if (n) for (let k = 0; k < 3; k++) F[3 * q + k] = s[k] / n;
    }
  }
  for (let y = 0; y < bh; y++) for (let x = 0; x < bw; x++) {
    const q = y * bw + x;
    if (!isHole[q]) continue;
    const p = (y + y0) * w + x + x0;
    im.d[4 * p] = Math.round(F[3 * q]); im.d[4 * p + 1] = Math.round(F[3 * q + 1]); im.d[4 * p + 2] = Math.round(F[3 * q + 2]); im.d[4 * p + 3] = 255;
  }
  return im;
}

/** the share of a window round a hole pixel that must be picture (outside the hole) to read its strands' way from */
const SPREAD_MIN = 0.15;

/**
 * Fill the pixels of `hole` in hair along its strands (a brow drawn across the bangs, say): each hole pixel takes the
 * colours where its strand comes out of the hole on either side, mixed by distance, so the strands' light and dark
 * lines run on through instead of blurring into a soft patch. The strands run the way the picture round the hole does
 * (its structure tensor; the edges where strands meet the skin between them count too), read from further off in the
 * middle of a thick hole. A pixel whose strand leaves the hole on neither side within `reach` onto `known` (it runs off
 * the hair, onto the face), or where the picture has no clear direction, keeps smoothFill's colour. So does flat hair
 * with no strand lines near: its faint shading has a direction too, which can run along the hole to a line far off.
 * Changes `im` in place; alpha in the hole becomes 255.
 */
export function strandFill(im, hole, known, w, h, o = {}) {
  smoothFill(im, hole, known, w, h);
  const reach = o.reach ?? 40, r = o.r ?? 8;
  let x0 = w, y0 = h, x1 = -1, y1 = -1;
  for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) if (hole[y * w + x]) { if (x < x0) x0 = x; if (x > x1) x1 = x; if (y < y0) y0 = y; if (y > y1) y1 = y; }
  if (x1 < 0) return im;
  x0 = Math.max(0, x0 - reach); y0 = Math.max(0, y0 - reach); x1 = Math.min(w - 1, x1 + reach); y1 = Math.min(h - 1, y1 + reach);
  const bw = x1 - x0 + 1, bh = y1 - y0 + 1, n = bw * bh, at = (x, y) => (y + y0) * w + x + x0;
  const lum = new Float32Array(n);
  for (let y = 0; y < bh; y++) for (let x = 0; x < bw; x++) {
    const i = 4 * at(x, y);
    lum[y * bw + x] = 0.299 * im.d[i] + 0.587 * im.d[i + 1] + 0.114 * im.d[i + 2];
  }
  // the structure tensor from the picture outside the hole, spread over it (normalised: an average of what is there)
  const J = [new Float32Array(n), new Float32Array(n), new Float32Array(n)], M = new Float32Array(n);
  for (let y = 1; y < bh - 1; y++) for (let x = 1; x < bw - 1; x++) {
    let near = false;
    for (let j = -1; j <= 1 && !near; j++) for (let i = -1; i <= 1; i++) if (hole[at(x + i, y + j)]) { near = true; break; }
    if (near) continue;
    // Sobel: smoothed across, so a line at a slant reads at its slant and not as the steps of the pixel grid
    const q = y * bw + x, L = (i, j) => lum[q + j * bw + i];
    const gx = L(1, -1) + 2 * L(1, 0) + L(1, 1) - L(-1, -1) - 2 * L(-1, 0) - L(-1, 1);
    const gy = L(-1, 1) + 2 * L(0, 1) + L(1, 1) - L(-1, -1) - 2 * L(0, -1) - L(1, -1);
    J[0][q] = gx * gx; J[1][q] = gx * gy; J[2][q] = gy * gy; M[q] = 1;
  }
  // spread at r by the hole's edge, and further (2r, 4r) into the middle of a thick brow, where nothing of the picture
  // is within r: the fill kept a smooth colour there and cut every strand line across the brow's middle
  const spread = [r, 2 * r, 4 * r].map((s) => ({ Mb: blur(M, bw, bh, s), Jb: J.map((f) => blur(f, bw, bh, s)) }));
  // bilinear over the known hair pixels round (X, Y); null where they are less than half of it
  const sample = (X, Y) => {
    const ax = Math.floor(X), ay = Math.floor(Y), fx = X - ax, fy = Y - ay, c = [0, 0, 0];
    let wt = 0;
    for (const [i, j, f] of [[ax, ay, (1 - fx) * (1 - fy)], [ax + 1, ay, fx * (1 - fy)], [ax, ay + 1, (1 - fx) * fy], [ax + 1, ay + 1, fx * fy]]) {
      if (i < 0 || j < 0 || i >= w || j >= h || f <= 0) continue;
      const e = j * w + i;
      if (!known[e] || hole[e]) continue;
      wt += f; c[0] += f * im.d[4 * e]; c[1] += f * im.d[4 * e + 1]; c[2] += f * im.d[4 * e + 2];
    }
    return wt >= 0.5 ? c.map((v) => v / wt) : null;
  };
  const out = [];
  for (let y = 0; y < bh; y++) for (let x = 0; x < bw; x++) {
    const p = at(x, y);
    if (!hole[p]) continue;
    const q = y * bw + x;
    // the nearest spread with enough of the picture in it (a few rows of a window that is mostly hole)
    const sp = spread.find((s) => s.Mb[q] >= SPREAD_MIN);
    if (!sp) continue;
    const { Mb, Jb } = sp, a = Jb[0][q] / Mb[q], b = Jb[1][q] / Mb[q], c = Jb[2][q] / Mb[q];
    const coh = Math.hypot(a - c, 2 * b) / (a + c + 1e-6);
    // how sure the way is: the gradients agree on it (coherence), and they are lines, not a faint shading (by this
    // measure a 2 px line 40 levels dark in the window gives about 75, a shading of a level a pixel 8)
    const en = Math.sqrt(a + c);
    const sure = Math.min(1, Math.max(0, (coh - 0.2) / 0.3)) * Math.min(1, Math.max(0, (en - 12) / 20));
    if (sure <= 0) continue;
    // the gradient's way is the dominant one; the strands run across it
    const th = 0.5 * Math.atan2(2 * b, a - c), dx = -Math.sin(th), dy = Math.cos(th);
    const ends = [];
    for (const s of [1, -1]) {
      let found = null;
      for (let t = 0.5; t <= reach; t += 0.5) {
        const X = Math.round(x + x0 + s * t * dx), Y = Math.round(y + y0 + s * t * dy);
        if (X < 0 || Y < 0 || X >= w || Y >= h) break;
        const e = Y * w + X;
        if (hole[e]) continue;
        if (!known[e]) break;
        // the strand's colour where it comes out: the first few hair pixels past the hole, sampled between pixels (a
        // thin line at a slant would break up into steps)
        const acc = [0, 0, 0];
        let k = 0;
        for (let u = 0; u < 3; u++) {
          const c2 = sample(x + x0 + s * (t + u) * dx, y + y0 + s * (t + u) * dy);
          if (!c2) break;
          acc[0] += c2[0]; acc[1] += c2[1]; acc[2] += c2[2]; k++;
        }
        if (k) found = { c: acc.map((v) => v / k), t };
        break;
      }
      if (found) ends.push(found);
    }
    if (!ends.length) continue;
    const along = ends.length === 1 ? ends[0].c : ends[0].c.map((v, k) => (v * ends[1].t + ends[1].c[k] * ends[0].t) / (ends[0].t + ends[1].t));
    out.push([p, along, sure]);
  }
  for (const [p, along, sure] of out) {
    for (let k = 0; k < 3; k++) im.d[4 * p + k] = Math.round(sure * along[k] + (1 - sure) * im.d[4 * p + k]);
  }
  return im;
}

slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall