技能圖譜SKILLSGROVE
技能圖譜/影片製作/CodingWithLewis/TextFocus/textfocus

textfocus

安裝

$npx skills add https://github.com/CodingWithLewis/TextFocus --skill textfocus
$git clone --depth 1 https://github.com/CodingWithLewis/TextFocus.git /tmp/TextFocus && mkdir -p ~/.claude/skills && cp -r /tmp/TextFocus/. ~/.claude/skills/textfocus
請幫我安裝這個 Agent Skill:https://github.com/CodingWithLewis/TextFocus/tree/fb39b1a854b620711636cf9be0e606a5f2a1711d/ ,先閱讀它的 SKILL.md 和指令碼,確認安全後再安裝到我的技能目錄。

簡介

原文描述 · MITAlign and center a specific word across multiple images using OCR (Tesseract) to produce documentary-style "word focus" cuts. Use when the user wants to center/lock a keyword across screenshots or video frames, create news-ticker style alignment, produce same-word cuts for After Effects / Premiere, or batch-crop frames so a chosen word stays perfectly centered and same-size. Invoked via the installed `quick-cuts` CLI.
以下 SKILL.md 內容轉載自 CodingWithLewis/TextFocus(提交 fb39b1a),依據 MIT 許可證轉載正文(文字未改動;僅省略檔案頭後設資料、將圖片顯示為連結,超長內容會截斷);版權歸 2024 Quick Cuts Contributors 所有。許可證:LICENSE。僅展示說明檔案,附帶指令碼請在原倉庫檢視。

TextFocus (Quick Cuts) Skill

A Python-based OCR alignment tool that finds a target word in each input image and produces an output image where that word is centered and scaled to a consistent size. Designed for creating documentary / news-style video cuts where the same word stays locked in place across different footage.

When to use this skill

Activate when the user asks to:

  • "Center the word X across these images/frames"
  • "Align all these screenshots on the word Y"
  • "Make a Warp-style / documentary cut where a word stays fixed"
  • Batch-process video frames so a keyword is locked to the center
  • Normalize word size and position across many images

If the user only wants generic image cropping (no OCR / no target word), this skill is not the right fit.

Prerequisites

Before running anything, verify the environment:

  1. Tesseract OCR must be installed on the system (Python-only install is not enough):
  2. Python 3.8+
  3. The quick-cuts CLI itself — install from this repo with uv:
    uv tool install .
    quick-cuts --help
    
    If quick-cuts is not on PATH after install, run uv tool update-shell once and reopen the shell.

If Tesseract is missing, tell the user to install it — do not try to work around it.

Primary tool: quick-cuts

quick-cuts <images> -w "<target_word>" [options]

<images> can be a glob (images/*.png), a directory (images/), or individual files.

Common options

Flag Purpose Default
-w, --word Target word to center (required) —
-o, --output Output directory ./aligned_<word>
-s, --size Output canvas WxH 1920x1080
--word-height Target word height in px 100
--background white | black | transparent | dominant dominant
--partial Match words starting with the target (e.g. warp → warpdotdev) off
--workers Parallel worker count CPU count

Typical invocations

# Basic — center "breaking" across PNGs
quick-cuts images/*.png -w "breaking"

# Partial match — useful when the target is a prefix of a longer word
quick-cuts images/ -w "warp" --partial

# 4K output with larger word
quick-cuts images/ -w "alert" -s 3840x2160 --word-height 200

# Vertical / social-media format, transparent background
quick-cuts frames/ -w "viral" -s 1080x1920 --background transparent

Transparent background forces .png output regardless of input format.

Working guidance for Claude

When the user asks for a word-alignment task:

  1. Confirm the target word and the input path before running — mistakes here waste a batch.
  2. Check image formats — supported: .jpg, .jpeg, .png, .bmp, .tiff.
  3. Run once on a small sample first (1–3 images) to verify OCR actually finds the word, before processing a full folder.
  4. If OCR misses, suggest in order: --partial, higher-resolution source images, better contrast. Do not silently change the target word.
  5. Output files are named aligned_<original> in the output dir. Tell the user where they landed (output_dir.absolute() is logged).
  6. Progress / failures are printed to stdout. Surface the "Failed to find word in:" list back to the user so they know which frames need manual attention.
  7. If quick-cuts is not found, the user hasn't installed it yet — point them at uv tool install . from this repo, not python quick_cuts.py.

Files in this skill

  • pyproject.toml — defines the quick-cuts entry point
  • quick_cuts.py — source of the CLI (invoked via the installed quick-cuts command, not directly)
  • requirements.txt — dev-install dependency list (the CLI install uses pyproject.toml instead)
  • README.md — full user-facing docs
  • examples.md — worked examples
  • docs/example.gif — visual reference of the effect
檢視許可證全文(MIT)
MIT License

Copyright (c) 2024 Quick Cuts Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.