Brick Mosaic Skill — AI skill for Claude Code
把任意图片转换成乐高(LEGO)积木马赛克像素画,使用官方乐高 Art 套装配色,生成预览图、SVG 拼搭说明书和零件采购清单;支持 AI 风格优化(效果不好时用 imageGen 图片编辑强化主体后再生成).
How to install Brick Mosaic Skill
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open liangdabiao/brick-mosaic-skill and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Brick Mosaic Skill does
把任意图片转换成乐高(LEGO)积木马赛克像素画,使用官方乐高 Art 套装配色,生成预览图、SVG 拼搭说明书和零件采购清单;支持 AI 风格优化(效果不好时用 imageGen 图片编辑强化主体后再生成)。用户提到 乐高马赛克、LEGO mosaic、像素画、积木拼图、brick art、把照片/头像转成乐高风、马赛克拼搭说明书、用乐高套装拼人像、AI 优化像素画 等意图时使用——即使用户只是发一张图片说"做成像素风"或"乐高风格"也应触发。
Alternatives in AI
- Architecture Diagram Generator — Generate beautiful dark-themed system architecture diagrams as standalone HTML/SVG files 7k ★
- Hindsight — State-of-the-art long-term memory for AI agents by Vectorize 6.7k ★
- Pixel Agents — Compressed Reference — VS Code extension with embedded React webview: pixel art office where AI agents (Claude Code terminals) are an 6.5k ★
README
brick-mosaic — 把照片变成乐高像素画
你有没有想过:自己拍的一张照片,用家里落灰的乐高 Art 套装真的拼出来挂在墙上?
这个工具就是干这个的——**给它一张照片,它还你三样东西**:
- 🖼️ 效果图:照片被"翻译"成乐高颗粒的样子,先看效果再决定拼不拼
- 📖 拼搭说明书:和乐高官方说明书一个套路——先看总览,再一区一区(16×16)照着编号拼
- 🛒 零件清单:每种颜色要多少颗、零件编号是多少,分拣颗粒时照着勾
背后用的是 [brickMosaic 开源项目](https://github.com/liangdabiao) 的核心算法:把照片的每一种颜色,换成你套装里**真的有**的颜色,并且保证每种颜色用的数量不超过套装里的存量——所以拼到最后永远不会缺一颗。
最简单的用法
一句话需求,工具自动搞定:
"把 D:\照片.jpg 做成 48×48 的乐高像素画,我有蝙蝠侠套装"
它就会调用一条命令(你也可以自己在终端里跑):
node .agents/skills/brick-mosaic/scripts/mosaic.js 照片.jpg --size 48x48 --sets batman:1
跑完去 `mosaic-output/` 文件夹里看:`preview.png` 是效果图,`instructions/index.html` 用浏览器打开就是说明书(按 Ctrl+P 还能存成 PDF)。
常用功能速览
想换尺寸?
| 尺寸 | 需要颗粒 | 大概要几套(每套 2304 颗) |
|---|---|---|
| 48×48 | 2304 | 1 套 |
| 64×64 | 4096 | 2 套 |
| 96×96 | 9216 | 4 套 |
--size 64x64 --sets batman:2 # 大一点,细节更多
想裁掉多余背景?
照片是竖的、目标是正方形?加 `--fit center` 自动裁中间;想精确框选区域用 `--crop x,y,w,h`。工具检测到照片比例和目标差得多时也会主动提醒你。
想调色?
--adjust sat=-20,contrast=15 # 降饱和 + 加对比,更贴近乐高色
可调项:`hue` 色相 / `sat` 饱和度 / `val` 明度 / `contrast` 对比度 / `shadows` 暗部 / `highlights` 亮部,范围都是 -100 到 100。
效果不好?试试 AI 优化
照片背景乱、主体不突出的时候,直接说:
"效果不好,帮我 AI 优化一下"
工具会把照片交给 AI 处理成"纯黑背景 + 多边形艺术风格"——背景不占颗粒,所有积木全部用来拼主体,48×48 也能拼得很传神。处理后自动重新生成,新旧效果摆在一起给你挑。
支持的乐高 Art 套装
| key | 套装 | 编号 | 特点一句话 |
|---|---|---|---|
artProject |
艺术创作 | 21226 | 颜色最全,不知道选啥就用它 |
elvis |
猫王 | 31204 | 肤色层次多,拼人像首选 |
beatles |
披头士 | 31198 | 色系均衡的通用款 |
batman |
蝙蝠侠 | 31205 | 黑蓝主导,暗色照片很搭 |
ironMan |
钢铁侠 | 31199 | 红金配色 |
sith |
西斯 | 31200 | 黑红高对比,暗黑系 |
hogwarts |
霍格沃茨 | 31201 | 深蓝深绿,复古风 |
monroe |
玛丽莲·梦露 | 31197 | 只有 7 色,波普海报风 |
mickey |
米老鼠 | 31202 | 黑白卡通 |
portrait |
自定义肖像 | 41958 | 黑白灰 5 色,黑白照片很妙 |
world |
世界地图 | 31203 | 颗粒最多(9216),拼大件 |
套装可以混着用:`--sets elvis:1,artProject:1` 颜色和颗粒都翻倍。还有个进阶玩法:写小数 `--sets beatles:0.9` 故意"克扣"颗粒,算法被迫用更多颜色,成品反而更有艺术感。
常见问题
**Q:要安装什么吗?** 不用。只需要电脑上有 Node.js(14 以上),没有其他任何依赖。PNG/JPEG 照片直接
Related Skills
ChatGPT Imagegen
Use your ChatGPT subscription to generate images from the command line — no OPENAI_API_KEY, no gateway, no dae
Brick SR1
brick is a smart AI Models router, based on complexity & capabilities extraction from the query to the models
Comic Ip Onboarder Skill
把照片、头像、玩偶或吉祥物转成可复用漫画 IP 档案的 AI Agent Skill
Pretty Mermaid Skills
To provide AI with Mermaid chart rendering capability, supporting both SVG and ASCII output formats.
Claude Code Design AI
Claude Design: AI UI/UX architect. Screenshot to React, Figma components, Tailwind CSS generator. Prototyping
AI Vampire Guard
Monitor your Claude Code burn rate. Prevent AI-amplified burnout. Single-file Python script with SVG gauge, tr
Related Agents
SVG Creator
Load when the user wants an SVG made or fixed — an icon, illustration, logo mark, mascot pose, chart glyph, or
Audit Local
Evaluates local SEO signals — GBP optimization, NAP consistency, reviews, local schema, citation authority — f
SEO Local
Local SEO specialist. Analyzes GBP signals, NAP consistency, citations, reviews, local schema, location page q