Community影像github.com

Dither(抖色處理)

將照片與圖片轉換為抖色(dither)、半色調(halftone)或點陣圖(bitmap)風格,支援 Floyd-Steinberg、Atkinson、Bayer、半色調點、雙色調、Risograph 風格色彩,輸出為 PNG 或 SVG,適用於螢幕顯示或印刷。

Dither(抖色處理) 是什麼?

Dither 是一個 AI agent 技能,專門將任何圖片轉換為抖色或半色調點陣圖。它提供 14 種不同的演算法(如 Floyd-Steinberg、Atkinson、Bayer 柵格、半色調點),支援單色、灰階、雙色調與全彩 Risograph 風格調色板,並可輸出為 PNG 或 SVG 向量格式。此技能特別適合用於產生「復古 Mac」、「報紙」、「網點」、「絲網印刷」、「雷射雕刻」或「繪圖機」等視覺效果。其核心腳本為 `scripts/dither.py`,使用者需設定方法、點大小與調色板,並在輸出前視覺檢查結果。支援平台包括 Claude Code、Cursor 與 Codex 等 AI agent 工具。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Remicht0/graphic-design-skills/tree/HEAD/skills/dither

Installed? Explore more 影像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Dither(抖色處理) 是做什麼的?

將任何圖片轉換為抖色或半色調點陣圖,使用 scripts/dither.py 腳本。腳本負責像素處理;你只需選擇方法、點大小與調色板,確保結果在最終尺寸下清晰可讀,並在交付前進行視覺檢查。

工作流程

  1. 取得圖片及其用途。 圖片將會用在哪裡:Instagram 貼文、海報、T-shirt 印刷、雷射雕刻、網頁主圖?用途決定了點大小與格式(參見「尺寸設定」)。
  2. 若使用者未指定方法,先產生一組對比表。 大約一秒內即可呈現所有 14 種方法的並排比較:
    python3 scripts/dither.py input.jpg --compare -o compare.png --width 320 --scale 2
    
    檢視結果,挑選 1–2 種適合圖片與意圖的方法。如果使用者在場,可將對比表展示給他們看。
  3. 以正確尺寸進行最終渲染,然後查看輸出(打開 PNG 檔)再交付。確認臉部、文字與主體邊緣仍然可辨識。若否,請參考「修正弱結果」。
  4. 交付檔案時附上一行設定說明(方法、寬度、調色板),方便使用者要求變化。

選擇方法

想要的視覺風格方法備註
經典、有機顆粒感floyd-steinberg安全預設。加上 --serpentine 可消除對角線「蠕蟲」紋路。
老 Mac / 編輯點陣、強烈對比atkinson會犧牲部分陰影與亮部細節,因此對比度感受更高。非常適合人物肖像、物體與大膽形狀。
最平滑的漸層jjn、stucki、sierra較大核心,最適合天空與皮膚類漸層。
復古網格、像素藝術、遊戲風格bayer4、bayer8有序圖案:規則交叉線條,圖形感強,平鋪表現佳。動畫中最穩定(影格間無閃爍)。
報紙、Risograph、絲網印刷halftone真正的圓形、方形或線條點,帶有網點角度(--dot、--angle、--cell)。
海報 / 模板threshold無抖色;可搭配 --contrast 使用。
顆粒感、影印噪點random使用 --seed 可產生可重複的輸出。

調色板與色彩

  • 預設為純黑白。--levels 4 可得到 4 個灰階。
  • 雙色調: 傳入兩個顏色,墨水色在前或後皆可(系統會按亮度排序):--palette "#1F2BD1,#F3F2EE"。這通常是最具「設計感」的結果:墨水色印在米白紙上。
  • 預設組合: bw、gray4、gray8、rgb8、riso、newsprint、blueprint。使用 python3 scripts/dither.py --list 可列出所有選項。
  • 彩色抖色: --color --palette riso(或任何由 3 個以上十六進制顏色組成的清單)會進行彩色抖色,透過光學混合調色板點。最適合搭配誤差擴散方法,並使用包含深色、淺色與 2–3 個飽和色的調色板。

尺寸設定(最容易搞錯的部分)

--width 是橫向的點數。點數越少 = 像素越大越明顯。--scale 則以最近鄰插值放大每個點,使其保持完全清晰。

  • 螢幕用途: 最終像素寬度 ÷ scale = width。1080 px 的 Instagram 貼文,想要粗點:--width 270 --scale 4;想要細顆粒:--width 540 --scale 2。
  • 印刷用途: 先決定可見的點大小。例如一張 50 公分寬的海報,以 300 dpi(5906 px)印刷,點大小約 1 mm:--width 500 --scale 12(500 點 × 12 = 6000 px)。千萬不要之後再對 PNG 做平滑重採樣放大,否則點會模糊。
  • 半色調 以輸出解析度運作:使用 --width(並設 --scale 1)指定最終像素大小,再用 --cell(像素單位)設定點距。在 300 dpi 下,--cell 12 ≈ 25 lpi(線/英寸),呈現明顯的「普普藝術」網點;--cell 6 ≈ 50 lpi,具有報紙感。
  • SVG(-o out.svg)會產生向量方格,非常適合雷射雕刻、割字、繪圖機或無限縮放。請保持 --width 較小(約 400 以下),否則檔案會變得很重;腳本會在超過 25 萬個矩形時發出警告。

修正弱結果

  • 主體淹沒在雜亂中 → 減少 --width 不要那麼激進,加上 --sharpen,或提高 --contrast 1.2。
  • 整體過暗(抖色常見問題) → --gamma 1.3 或 --brightness 0.08。
  • 陰影在 Atkinson 中阻塞 → 改用 floyd-steinberg,或透過 --gamma 提亮。
  • 雜亂背景與主體競爭 → 先裁剪,或在抖色前移除背景。
  • 白色主體在白紙上消失 → 加上 --invert 或選擇較暗的紙張顏色。

範例

# Instagram 方形,粗顆粒 Atkinson 雙色調
python3 scripts/dither.py photo.jpg -o post.png -m atkinson --width 270 --scale 4 --palette "#111111,#E9E7E1"

# A3 海報(297 mm @ 300 dpi ≈ 3508 px),圓形半色調點,45° 角度
python3 scripts/dither.py photo.jpg -o poster.png -m halftone --width 3508 --cell 14 --angle 45

# Risograph 風格彩色抖色
python3 scripts/dither.py photo.jpg -o riso.png -m floyd-steinberg --color --palette riso --width 600 --scale 2 --serpentine

# 用於雷射雕刻的向量檔
python3 scripts/dither.py logo.png -o engrave.svg -m bayer4 --width 240

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

art-direction-analyzer

Break down the art direction of a live website — typography, color palette, grid and spacing, motion and interactions, imagery — by inspecting the rendered page (computed styles, screenshots, hover states), and save a structured reference file with screenshots for a design inspiration library. Use whenever the user wants to study, deconstruct, scrape or reverse-engineer a site's design, visual identity, UI or motion, save a site as a reference or moodboard entry, or asks "how did they do this" about a website — even without the word "analysis".

editorial-layout

Design editorial, magazine-style PDF layouts in HTML/CSS — briefs, reports, portfolios, zines, presentations, posters, Instagram carousels — on a 12-column print grid with extreme type scale, one accent color, bleeding images and varied compositions, then render to a print-ready PDF (with bleed) plus PNG previews and automatic layout checks. Use whenever the user wants a document, PDF, deck, booklet or boards that look designed rather than templated, or asks for a magazine, editorial or Swiss-style layout.

palette

Build, check and export color palettes — extract one from a photo or moodboard, generate tints and shades (50–950) or harmonies in OKLCH, check WCAG contrast, and export to CSS variables, Tailwind, design tokens, Adobe ASE (Illustrator/InDesign/Photoshop), GIMP/Krita GPL or a swatch sheet. Use whenever the user wants a color palette, a color scale, "colors that go with" something, a contrast or accessibility check, or swatches for a design tool.

print-preflight

Check a PDF before it goes to the printer — bleed, trim size, image resolution at placed size, embedded fonts, RGB vs CMYK vs spot colors, total ink coverage, hairlines, transparency, layers and annotations — and explain each problem with the fix for InDesign, Illustrator, Affinity, Canva or Figma. Use whenever the user is about to print something (flyer, poster, business card, book, zine, packaging) or asks "is my file OK for print", "why did the printer reject my file", or wants a PDF checked.

相關技能