[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111833":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":12,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":21,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":14,"starSnapshotCount":14,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},111833,"doll-studio","link-ding\u002Fdoll-studio","link-ding","Turn a layered PSD into an animated 2D character — web editor, player and macOS desktop pet. 中英双语。",null,"JavaScript",60,1,53,0,7,39.1,false,"main",true,[],"2026-11-10 02:29:01","2026-11-20 08:27:56","# Doll Studio\n\n**English** | [简体中文](README.zh-CN.md)\n\nTurn a layered PSD split by See-through (or by the [image-to-psd](https:\u002F\u002Fgithub.com\u002Flink-ding\u002Fimage-to-psd) skill) straight into an animated 2D character. No Live2D or Inochi2D needed. The idle motion, lip sync and face tracking are ported from the open-source LivLiv Player, and the face model is Google MediaPipe (both Apache 2.0, see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)). Everything runs locally:\n\n| Module | Files | What it does |\n|---|---|---|\n| PSD reader | `src\u002Fpsd.js` | Our own PSD\u002FPSB reader (RLE \u002F ZIP compression, layer masks, layer groups, 8\u002F16-bit) |\n| Layer clean-up | `src\u002Fcleanup.js` | Tidies PSD layers before rigging: removes loose ink fragments and covers hair colour that bled into the face under the bangs with skin; then replays the editor's touch-up strokes in order (erase, cover, move to another layer, restore) |\n| Auto rig | `src\u002Fautorig.js` `src\u002Froles.js` | Recognises parts by layer name, splits left and right eyes, builds meshes and the mouth interior, measures the face |\n| Runtime | `src\u002Frig.js` | Parameters → vertex deformation: 2.5D head turn, blinking, eyeballs, mouth shapes (including round\u002Fflat vowels), breathing, hair physics |\n| Renderer | `src\u002Frenderer.js` | WebGL mesh rendering, with the stencil buffer clipping the pupils |\n| Driver | `src\u002Fdriver.js` | Combines the three below with click reactions and task alerts |\n| Idle motion | `src\u002Fidle.js` | Natural sway from random noise plus springs, uneven breathing, double blinks, a small gesture every 10–20 s; when following the gaze the head turns only about 13° and the eyes lead |\n| Lip sync | `src\u002Fvoice.js` | Microphone auto-gain, splitting o\u002Fu (round) and i\u002Fe (flat) by spectrum |\n| Face tracking | `src\u002Ftracking.js` + `vendor\u002Fmediapipe\u002F` | Camera → head turn, blinks, gaze, brows, mouth, smile; calibrates itself after a second of holding still facing the camera |\n| Model format | `src\u002Fformat.js` | `.doll` files, see [FORMAT.md](FORMAT.md) |\n| Interface language | `src\u002Fi18n.js` `electron\u002Fmain.js` | English and Chinese, switchable live |\n| Editor | `index.html` `src\u002Feditor.js` | Open a PSD, adjust the rig, preview live, export |\n| Player | `player.html` `src\u002Fplayer.js` | Plays a `.doll`; works as a browser source in streaming apps |\n\n## Interface language\n\nThe editor, the player and DollPet's menus and settings all come in English and Chinese:\n\n- The web pages (editor, player) follow the browser's language. The **EN \u002F 中文** button in the header \u002F control bar switches at any time and the choice is remembered in the browser; add `?lang=en` or `?lang=zh` to the URL to pin a language.\n- DollPet follows the system's preferred language. At the bottom of its popover, pick **Auto \u002F 中文 \u002F EN**: the menus, the popover, the pet's alert bubbles and the editor switch at once. The editor's language button switches the whole app too.\n- Exported web pages follow the viewer's browser language.\n\n## Running\n\nES modules in the browser need a local server:\n\n```bash\ncd doll-studio && python3 -m http.server 8765\n```\n\nThen open \u003Chttp:\u002F\u002Flocalhost:8765> and drop in a PSD.\n\nThe MediaPipe files face tracking needs (about 17 MB) live in `vendor\u002Fmediapipe\u002F`. If they are missing, run `vendor\u002Ffetch-mediapipe.sh` once. The first time face tracking starts it compiles WebAssembly: about 6 s in a browser, about 15 s in DollPet; turning it on again in the same session is quick.\n\n## Making the PSD: image-to-psd\n\nDoll Studio relies heavily on **[image-to-psd](https:\u002F\u002Fgithub.com\u002Flink-ding\u002Fimage-to-psd)**, an agent skill (Claude Code, Codex…) that turns a single character illustration (PNG \u002F JPG \u002F SVG) into a layered PSD with 19 standard parts (`back hair`, `front hair`, `face`, `eyewhite`, `irides`, `eyelash`, `mouth`…), each with its own pixels and an editable mask. It fills in what is hidden, such as the face under the bangs, the back hair behind the head and the eye whites under the irises, so turning the head shows no holes. Its layer names are the ones the auto rig recognises, so its PSDs open in Doll Studio as-is.\n\n```bash\nnpx skills add link-ding\u002Fimage-to-psd --skill image-to-psd -g -y\n```\n\nThen give your agent a character image and ask it to \"use image-to-psd to split this character artwork into a layered PSD\". See the [image-to-psd README](https:\u002F\u002Fgithub.com\u002Flink-ding\u002Fimage-to-psd#readme) for the full layer list, examples and the standalone export script.\n\n## Workflow\n\n1. **Open a PSD**: See-through's layer names (`front hair`, `eyewhite`, `irides`…) are recognised automatically.\n2. **Check the parts**: any part in the left list that was guessed wrong can get another type; the rig rebuilds right away.\n3. **Tune the control points**: the head center, head radius, neck pivot and both eyelid lines can be dragged (the middle dot of an eyelid line moves the whole line, the small end dots set its width and tilt, snapping back to level near horizontal).\n4. **Touch up**: the **Touch up** tab on the right. **Clean up stray strokes** is on by default and lists what it cleaned in each layer. Pick a part on the left and paint on the canvas: **Erase** removes stray bits, **Cover** paints over with a colour (Alt-click to pick a colour from the part), **Move** moves lines that ended up on the wrong layer to another one: paint loosely over a hair line on the face and only the pixels that aren't the face's own colour move into the front hair, with the gap filled in skin colour; afterwards the front hair gives a little shake to show those lines now move with the hair. **Restore** brings back the original. Turn on **Show only this part** to see what other layers hide. The character holds still while you paint; Space-drag pans, `[` `]` resize the brush, ⌘Z undoes. Strokes are saved per file along with the control points, and carried into exported `.doll` files and the desktop pet.\n5. **Tune parameters**: drag each parameter by hand on the right, and adjust the head-turn amount and the physics of each hair group.\n6. **Export**:\n   - `.doll`: the model file, for the player or for editing later.\n   - **Web page**: a single self-contained HTML file you can double-click to view, no server needed.\n\n## Streaming\n\nIn OBS, add a **Browser Source** with the URL:\n\n```\nhttp:\u002F\u002Flocalhost:8765\u002Fplayer.html?model=your-model.doll&bg=transparent\n```\n\nPress H in the player to hide its controls; add `&lang=en` or `&lang=zh` to pin the interface language. With **Lip sync** on, the mouth moves as you talk.\n\n## Desktop app (Windows and macOS)\n\nDollPet puts the editor and the desktop pet in one app for Windows and macOS, built with Electron (`electron\u002F`). The web files ship inside the app and the app serves them itself, so no local server is needed. `src\u002F` has nothing Electron-specific: `electron\u002Fpreload.js` gives the pages their host interface.\n\n### Download\n\nGet the installer from [Releases](https:\u002F\u002Fgithub.com\u002Flink-ding\u002Fdoll-studio\u002Freleases):\n\n- `DollPet-\u003Cversion>-mac-arm64.dmg`: Macs with Apple silicon (M1 and later)\n- `DollPet-\u003Cversion>-mac-x64.dmg`: Intel Macs only\n- `DollPet-\u003Cversion>-windows-x64-setup.exe`: most Windows PCs (`…-windows-arm64-setup.exe` for Windows on Arm)\n\nThe builds are not signed yet. On Windows, SmartScreen warns the first time: More info → Run anyway. On macOS, open the app once, then allow it in System Settings › Privacy & Security › Open Anyway.\n\n### Using it\n\n- Click the tray icon (in the menu bar on macOS) for the popover: the current model, quick toggles (always on top, follow cursor, lip sync, face tracking, click-through, alert sound), size, Desktop pet \u002F Wallpaper, task alerts, recent models and language. Right-click it, or the character, for the classic menu.\n- **Open Editor** opens the editor window; **Set as Desktop Pet** in the editor puts the current model on the desktop right away. Exporting brings up the system save dialog.\n- The pet is transparent, borderless and always on top; the mouse passes through the transparent area around the character. The gaze follows the mouse anywhere on screen; drag the character to move it, click it and it smiles.\n- The eyelid lines, control points, part types and physics you set in the editor are remembered per file and restored next time; a re-exported or re-downloaded copy of the same character gets the earlier settings too (matched by the auto-measured position of the eyes and mouth).\n- Remembers the last model, position and settings, in `~\u002FLibrary\u002FApplication Support\u002FDollPet` (macOS) or `%APPDATA%\\DollPet` (Windows).\n\n### Wallpaper mode\n\nSwitch the popover to **Wallpaper** and the character lives on the desktop, under the icons, over the desktop picture, an animated scene, a room or a picture of your own (**+**, or drop pictures on the swatches). Pick a size and a side, or **Adjust on screen…**: drag the character, drag a dot on its top edge, scroll or pinch to resize, arrow keys to nudge, Return to keep, Escape to cancel. A scene, room or picture also becomes the system desktop picture; going back to the pet, or **Restore my picture**, puts yours back.\n\nElectron has no way to put a window under the desktop icons, so `electron\u002Fnative.js` calls the system through [koffi](https:\u002F\u002Fkoffi.dev\u002F): on macOS the window goes to the level just under the icons, on Windows into the desktop's WorkerW window. The Windows part is new and has not been tried on many machines yet.\n\n### Task alerts (Claude Code \u002F Codex)\n\nIn the popover, **Connect** next to Claude Code or Codex (click **Disconnect** to undo). When a task finishes a bubble pops up above the pet (which tool, which project, its last line), the pet smiles and a sound plays; when Claude Code needs you to approve a permission, the bubble turns orange and the pet widens its eyes and nods.\n\n- Claude Code: adds `Stop` and `Notification` hooks to `~\u002F.claude\u002Fsettings.json`, running `DollPet notify claude`\n- Codex: adds `notify = [\"…\u002FDollPet\", \"notify\", \"codex\"]` at the top of `~\u002F.codex\u002Fconfig.toml`\n- `DollPet notify` boils the event down to one line and hands it to the running pet; if the pet isn't running it does nothing and never gets in Claude Code's or Codex's way\n\nBefore changing a config file DollPet backs it up as `.dollpet-backup`, and keeps the last ten copies by time in its `Backups` folder. Config files are replaced whole, and a symlinked config is written to the file it points to. Your other hooks are kept; if Codex already has another notify program, DollPet runs it too and puts it back when disconnected. The config records the app's path, so connect again after moving the app.\n\n### Building\n\n```bash\ncd electron && npm install\nnpm start                      # the pet (npm start -- --editor also opens the editor)\nnpm run dist:mac               # or dist:win: installers in electron\u002Fdist\n```\n\n`vendor\u002Ffetch-mediapipe.sh` must have run once (face tracking). When `samples\u002Fseethrough.psd` is there, `npm start` shows it before you pick a model. The **Desktop app** workflow (`.github\u002Fworkflows\u002Fdesktop.yml`) builds the Windows and macOS installers on GitHub's machines; pushing a tag such as `v0.1.0` attaches them to a release.\n\nThe icon sources are in `brand\u002F`: `app-icon.svg` is the app icon, `logo-mark.svg` is the mark in the editor header and the web favicon, and `menubar-template.svg` is the menu bar icon. After changing an SVG, run `brand\u002Fmake-icons.sh` (needs Google Chrome to render) to regenerate the icons in `electron\u002Fbuild` and `electron\u002Fassets`.\n\n## Artwork requirements\n\n- Layer names should say which body part they are (See-through and [image-to-psd](https:\u002F\u002Fgithub.com\u002Flink-ding\u002Fimage-to-psd) output work as-is).\n- Parts that are covered should ideally be painted in fully (See-through and image-to-psd already do this), otherwise turning the head shows holes.\n- Higher resolution looks sharper: 768 px works, 2000 px and up looks better.\n\n## Not done yet\n\n- Hand-editing meshes and keyframe deformers\n- Expression presets and motion recording\n- Bones for separately drawn arms and body parts\n","Doll Studio 是一个将分层 PSD 文件转换为可交互 2D 动画角色的开源工具，支持网页编辑、实时播放及 macOS 桌面宠物形态。核心功能包括自研 PSD\u002FPSB 解析器（支持 RLE\u002FZIP 压缩、图层组与蒙版）、基于命名规则的自动绑骨（识别眼、嘴等部位并生成网格）、本地运行的实时驱动系统（含 MediaPipe 面部追踪、唇形同步、Idle 自然微动与 WebGL 渲染）。所有处理均在客户端完成，无需 Live2D 等商业中间件。适用于独立动画师、游戏原型开发者及桌面互动应用创作者快速构建轻量级 2D 角色。",2,"2026-11-24 04:41:56","CREATED_QUERY"]