Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Pixel Avatars can be an elf, dwarf, orc or talking flower with beards, medieval
- Drawn parts can be shared. An exported Bot carries the parts it wears, and importing it adds them to your Part Library marked **From an imported Bot**. A single part exports as a PNG that previews anywhere and imports back losslessly. The whole library exports as a zip of those PNGs. Imports merge identical parts, recompute each part's identity from its content, and refuse malformed or oversized files with a message. The library can be filtered by origin ([#1215](https://github.com/BotHarness/DeepSeekBot/issues/1215)).
- The part editor gains line and rectangle (hold Shift for straight angles and squares), a tone gradient with 4×4 or 2×2 dithering, noise with an amount and **Re-roll**, an eyedropper (or Alt-click / long-press), and a **Shade** pencil that makes cells lighter or darker once per stroke. Every tool mirrors and is one undo step. Results stay appearance colors at a tone, so the part still recolors. On touch, a two-finger tap undoes, a three-finger tap redoes, and an **Offset cursor** with a **Hold to draw** button keeps your finger off the pixel ([#1216](https://github.com/BotHarness/DeepSeekBot/issues/1216)).
- Every hair piece can have its own color: bangs, back hair and a new single strand (ahoge, curl or double) join the side hair colors, and each follows the hair color until you pick one. **Headpiece** now offers built-in cat, bunny and horse ears, little horns, a halo and new little wings, worn together with any accessory; the base tucks behind the hair and the far side hides when the head turns. Saved Avatars that wear these as accessories look the same until you edit them, when they move into the headpiece slot ([#1217](https://github.com/BotHarness/DeepSeekBot/issues/1217)).
- Pixel art from other tools can become a part: **Import part files** also takes a plain PNG of a part's size (32×32, 32×16, or a whole-number scale). You see its size and color count first, choose how many colors to keep (at most 32, nearest color, no dithering), and its pixels arrive as fixed colors that **Replace color** turns into appearance colors and tones. A built-in headpiece opens as a flattened starting canvas, and a part saved from someone else's part records its parent and keeps the original author's name. The library filter adds **Based on another part** and **From an imported image** ([#1219](https://github.com/BotHarness/DeepSeekBot/issues/1219)).
- Hair pieces can be drawn too: open bangs, left or right side hair or back hair and start from the style you wear, flattened to pixels. Reshape it with the same tools, save it to the Part Library and wear it in that slot. The drawn hair is shaded and recolored like built-in hair, turns with the head and hides under helmets, hoods and on flowers. **Back to the built-in style** restores your original choice ([#1238](https://github.com/BotHarness/DeepSeekBot/issues/1238)).
- You can draw your own headpiece for a pixel Avatar: pencil, eraser, fill, mirroring across the face, a front layer over the hair and a back layer behind it, undo and redo, and a 1× preview on the real Avatar. Colors can follow the Avatar's hair, skin, eye or outfit color in five tones, or be fixed. Saved parts go into a Part Library in your Profile and can be worn by any PersonaBot. The worn copy turns and speaks with the Window Companion and travels with an exported Bot, and editing a library part saves a new part without changing Avatars that already wear the old one ([#1211](https://github.com/BotHarness/DeepSeekBot/issues/1211)).
- Pixel Avatars can be an elf, dwarf, orc or talking flower. Beards always leave the speaking mouth visible. Armor, robe, tunic and cloak outfits are available, and a helmet or hood hides the hair underneath. Flowers have bead eyes, five petal styles and a stem or pot. Choices a species or headwear doesn't show stay saved, with a note, and return when switched back ([#1212](https://github.com/BotHarness/DeepSeekBot/issues/1212), [#1213](https://github.com/BotHarness/DeepSeekBot/issues/1213)).
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- 自绘部件可以分享了:导出的 Bot 会带上它戴着的部件,导入后这些部件会进入你的部件库,标记为“来自导入的 Bot”;单个部件可导出为任何地方都能预览的 PNG,并能无损导回;整个部件库可导出为这些 PNG 的 zip。导入时相同内容的部件会合并,并按内容重新计算部件身份,格式错误或过大的文件会被拒绝并给出提示;部件库可按来源筛选([#1215](https://github.com/BotHarness/DeepSeekBot/issues/1215))。
- 部件编辑器新增直线和矩形(按住 Shift 锁定直角和正方形)、带 4×4 或 2×2 抖动的明暗渐变、可调强度并可 **重新随机** 的杂色、吸管(也可按住 Alt 点击或长按),以及每笔只变亮或变暗一次的 **明暗笔**。所有工具都支持镜像,每次操作是一步撤销;结果仍是外形颜色加明暗,部件照样跟着变色。触屏上双指轻点撤销、三指轻点重做,**偏移光标** 配合 **按住绘制** 按钮,手指不会挡住要画的像素([#1216](https://github.com/BotHarness/DeepSeekBot/issues/1216))。
- 每片头发都能单独设颜色:前发、后发和新的单根呆毛(呆毛、卷翘或双呆毛)加入左右侧发颜色的行列,没选颜色时跟随发色。**头饰** 现在提供内置的猫耳、兔耳、马耳、小角、光环和新的小翅膀,可以和任意配饰一起戴;根部藏在头发后面,转头时远侧会隐藏。已保存的头像如果把这些当作配饰戴着,在你编辑前外观不变,编辑时会移到头饰位([#1217](https://github.com/BotHarness/DeepSeekBot/issues/1217))。
- 其他工具画的像素画也能变成部件:**导入部件文件** 现在也接受部件尺寸的普通 PNG(32×32、32×16 或其整数倍放大)。会先显示尺寸和颜色数,再选择保留几种颜色(最多 32 种,取最接近的颜色,不抖动);导入的像素是固定颜色,可以用 **替换颜色** 换成外形颜色和明暗。内置头饰可以作为压平的起点打开;基于别人部件保存的新部件会记录父部件并保留原作者名字。部件库筛选新增 **基于其他部件修改** 和 **来自导入的图片**([#1219](https://github.com/BotHarness/DeepSeekBot/issues/1219))。
- 头发也能自己画了:在前发、左右侧发或后发里,从当前戴的样式开始(压平成像素),用同样的工具改形状,存进部件库并戴在这个位置。自绘头发会像内置头发一样上阴影、跟着发色变色、随头部转动,戴头盔/兜帽或变成花朵时会隐藏。点 **换回内置样式** 可恢复原来的选择([#1238](https://github.com/BotHarness/DeepSeekBot/issues/1238))。
- 可以为像素头像自己画头饰:铅笔、橡皮、填充、沿脸部中线镜像,前层盖在头发上、后层在头发后面,支持撤销重做,并在真实头像上显示 1× 预览。颜色可以跟随头像的发色、肤色、眼睛或衣服颜色(五档明暗),也可以是固定色。保存的部件进入 Profile 里的部件库,任何 PersonaBot 都能戴上;戴上的副本会在窗口伙伴里随头部转动和说话,并随导出的 Bot 一起带走;修改库里的部件会另存为新部件,不会改变已经戴着旧部件的头像([#1211](https://github.com/BotHarness/DeepSeekBot/issues/1211))。
- 像素头像新增精灵、矮人、兽人和会说话的花。胡子始终露出说话的嘴,新增盔甲、法袍、束腰外衣和斗篷,戴上头盔或兜帽会遮住下面的头发。花有豆豆眼、五种花瓣样式,以及茎叶或花盆。当前物种或头饰不显示的选择会保留并给出提示,换回后恢复([#1212](https://github.com/BotHarness/DeepSeekBot/issues/1212)、[#1213](https://github.com/BotHarness/DeepSeekBot/issues/1213))。
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/botharness-architecture.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ Custom Parts are bounded pixel grids whose cells reference appearance colors or

New PersonaBots record a full-domain name-seed version; PersonaBots without it keep the human-only seed. Recipes using species, new slots or Custom Parts raise the asset/schema version and fall back to the saved snapshot on older Clients; existing recipes render unchanged. The first slice proves goblin, split side hair and one drawn headpiece from editor to Part Library to a Window Companion and through export/import.

Implemented so far: goblin, elf, dwarf, orc and flower species, split side hair, beards, medieval outfits and headwear, the full-domain seed (#1210, #1212–#1214), the first Custom Part path (#1211), drawn hair pieces (#1238), every other drawn part (#1240), part files (#1215), the full drawing tool set (#1216), and per-piece hair colors with built-in headpieces (#1217). Asset version 4 adds bangs, back hair and strand colors, a single strand, and a headpiece slot that holds a built-in headpiece or a Custom Part beside the accessory; the editor raises a recipe to version 4 only when the Human edits these, moving a headpiece accessory into the slot. A drawn bangs, side or back piece replaces the built-in piece while that choice stays saved; its live `hairColor` cells are shaded like built-in hair, so editing starts from the worn style flattened to cells. A drawn headpiece is an asset version 3 recipe. The Part Library is the `avatar-part-library` module's `avatar_part_library` table (schema generation 73), keyed by the part's content hash and holding name, origins and parent. The `partLibraryList`, `partLibraryAdd`, `partLibraryExport` and `partLibraryImport` bridge methods expose it to the Client editor (pencil with a lighter/darker shade modifier, eraser, 4-connected fill, line and rectangle with Shift snapping, a region-bounded tone gradient with 4×4 or 2×2 Bayer dithering, seeded ±1 tone noise with re-roll, an eyedropper by Alt-click or long-press, centerline mirror for every tool, front and back layers, one undo step per action with two- and three-finger tap undo and redo, an offset touch cursor, and a 1× preview; BotPixel computes every tool's cells, which stay appearance colors at a tone). The appearance embeds a copy of the part, so it travels in `.botharness/bot.json` and Bot Zips. `part-file` encodes one part as a ×8 preview PNG with the part data in a `botharness-part` tEXt chunk, and the library as a zip of such PNGs; import checks every chunk CRC and deduplicates by content. Importing a Bot adds the parts its appearance wears to the library with the `imported-bot` origin and the Bot's display name as author. Animal species and plain PNG import are still to come.
Implemented so far: goblin, elf, dwarf, orc and flower species, split side hair, beards, medieval outfits and headwear, the full-domain seed (#1210, #1212–#1214), the first Custom Part path (#1211), drawn hair pieces (#1238), every other drawn part (#1240), part files (#1215), the full drawing tool set (#1216), per-piece hair colors with built-in headpieces (#1217), and plain PNG import with derived editing (#1219). Asset version 4 adds bangs, back hair and strand colors, a single strand, and a headpiece slot that holds a built-in headpiece or a Custom Part beside the accessory; the editor raises a recipe to version 4 only when the Human edits these, moving a headpiece accessory into the slot. A drawn bangs, side or back piece replaces the built-in piece while that choice stays saved; its live `hairColor` cells are shaded like built-in hair, so editing starts from the worn style flattened to cells. A drawn headpiece is an asset version 3 recipe. The Part Library is the `avatar-part-library` module's `avatar_part_library` table (schema generation 73), keyed by the part's content hash and holding name, origins and parent. The `partLibraryList`, `partLibraryAdd`, `partLibraryExport` and `partLibraryImport` bridge methods expose it to the Client editor (pencil with a lighter/darker shade modifier, eraser, 4-connected fill, line and rectangle with Shift snapping, a region-bounded tone gradient with 4×4 or 2×2 Bayer dithering, seeded ±1 tone noise with re-roll, an eyedropper by Alt-click or long-press, centerline mirror for every tool, front and back layers, one undo step per action with two- and three-finger tap undo and redo, an offset touch cursor, and a 1× preview; BotPixel computes every tool's cells, which stay appearance colors at a tone). The appearance embeds a copy of the part, so it travels in `.botharness/bot.json` and Bot Zips. `part-file` encodes one part as a ×8 preview PNG with the part data in a `botharness-part` tEXt chunk, and the library as a zip of such PNGs; import checks every chunk CRC and deduplicates by content. Importing a Bot adds the parts its appearance wears to the library with the `imported-bot` origin and the Bot's display name as author. `part-image` decodes a plain PNG of a slot's size (or a whole-number scale), reports its color count through `partLibraryImport`, and `partLibraryImportImage` keeps the most frequent colors (nearest color, no dithering) as fixed-color cells with the `imported-image` origin. A part saved with a library parent gets the `derived` origin and the parent's author as `parentAuthor`. Animal species are still to come.

## 6 · Persistence, export, and restore boundaries

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/botharness-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ Custom Part 是有界像素网格,每格引用外形颜色或固定色并带

新 PersonaBot 记录全域名字种子版本;没有该记录的 PersonaBot 保持仅人类的种子。使用物种、新槽位或 Custom Part 的 recipe 提升 asset/schema 版本,旧 Client 显示保存的快照;既有 recipe 渲染不变。首个切片验证哥布林、左右侧发分片与一个自绘头饰,从编辑器到 Part Library、再到 Window Companion,并经过导出/导入。

目前已实现:哥布林、精灵、矮人、兽人和花物种,左右侧发分片,胡子,中世纪服装与头饰,全域种子(#1210、#1212–#1214),第一条 Custom Part 路径(#1211),自绘头发(#1238),自绘其他部件(#1240)、部件文件分享(#1215),完整绘制工具(#1216),以及每片头发单独配色与内置头饰(#1217)。asset version 4 新增前发、后发和呆毛颜色、单根呆毛,以及与配饰并存、可放内置头饰或 Custom Part 的头饰位;只有 Human 编辑这些项时编辑器才把 recipe 升到 version 4,并把作为配饰戴着的头饰移入头饰位。自绘的前发、侧发或后发会替换对应的内置部件,原来的选择仍会保留;其中发色的像素会像内置头发一样上阴影,所以编辑时从当前样式压平成的格子开始。自绘头饰的 recipe 是 asset version 3。Part Library 是 `avatar-part-library` 模块的 `avatar_part_library` 表(schema generation 73),以部件内容哈希为键,并保存名称、来源和父部件。Client 编辑器通过 `partLibraryList`、`partLibraryAdd`、`partLibraryExport` 和 `partLibraryImport` 四个桥接方法使用它;`part-file` 把单个部件编码为 ×8 预览 PNG,部件数据放在 `botharness-part` tEXt 块中,整个部件库导出为这种 PNG 的 zip,导入时校验每个块的 CRC 并按内容去重;导入 Bot 时其外形穿戴的部件以 `imported-bot` 来源加入部件库,作者为该 Bot 的显示名;编辑器提供带变亮/变暗明暗笔的铅笔、橡皮、四连通填充、按 Shift 锁定角度和正方形的直线与矩形、限定在区域内并带 4×4 或 2×2 Bayer 抖动的明暗渐变、可重新随机的 ±1 明暗杂色、Alt 点击或长按吸管、所有工具的中线镜像、前后两层、每次操作一步撤销(触屏双指撤销、三指重做)、触屏偏移光标和 1× 预览;每个工具的格子都由 BotPixel 计算,结果仍是外形颜色加明暗档位。外形嵌入部件副本,因此部件会随 `.botharness/bot.json` 和 Bot Zip 一起带走。动物物种和普通 PNG 导入尚未实现。
目前已实现:哥布林、精灵、矮人、兽人和花物种,左右侧发分片,胡子,中世纪服装与头饰,全域种子(#1210、#1212–#1214),第一条 Custom Part 路径(#1211),自绘头发(#1238),自绘其他部件(#1240)、部件文件分享(#1215),完整绘制工具(#1216),每片头发单独配色与内置头饰(#1217),以及普通 PNG 导入和派生编辑(#1219)。asset version 4 新增前发、后发和呆毛颜色、单根呆毛,以及与配饰并存、可放内置头饰或 Custom Part 的头饰位;只有 Human 编辑这些项时编辑器才把 recipe 升到 version 4,并把作为配饰戴着的头饰移入头饰位。自绘的前发、侧发或后发会替换对应的内置部件,原来的选择仍会保留;其中发色的像素会像内置头发一样上阴影,所以编辑时从当前样式压平成的格子开始。自绘头饰的 recipe 是 asset version 3。Part Library 是 `avatar-part-library` 模块的 `avatar_part_library` 表(schema generation 73),以部件内容哈希为键,并保存名称、来源和父部件。Client 编辑器通过 `partLibraryList`、`partLibraryAdd`、`partLibraryExport` 和 `partLibraryImport` 四个桥接方法使用它;`part-file` 把单个部件编码为 ×8 预览 PNG,部件数据放在 `botharness-part` tEXt 块中,整个部件库导出为这种 PNG 的 zip,导入时校验每个块的 CRC 并按内容去重;导入 Bot 时其外形穿戴的部件以 `imported-bot` 来源加入部件库,作者为该 Bot 的显示名;编辑器提供带变亮/变暗明暗笔的铅笔、橡皮、四连通填充、按 Shift 锁定角度和正方形的直线与矩形、限定在区域内并带 4×4 或 2×2 Bayer 抖动的明暗渐变、可重新随机的 ±1 明暗杂色、Alt 点击或长按吸管、所有工具的中线镜像、前后两层、每次操作一步撤销(触屏双指撤销、三指重做)、触屏偏移光标和 1× 预览;每个工具的格子都由 BotPixel 计算,结果仍是外形颜色加明暗档位。外形嵌入部件副本,因此部件会随 `.botharness/bot.json` 和 Bot Zip 一起带走。`part-image` 解码部件尺寸(或整数倍放大)的普通 PNG,经 `partLibraryImport` 报告颜色数,`partLibraryImportImage` 保留最常见的颜色(最近色、不抖动),以 `imported-image` 来源存为固定颜色的格子;带部件库父部件保存的部件来源为 `derived`,并以 `parentAuthor` 记录父部件作者。动物物种尚未实现。

## 6 · 持久化、导出与恢复边界

Expand Down
25 changes: 25 additions & 0 deletions docs/assets/pr/1219-png-import/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# #1219 Plain PNG import and derived editing

Captured on an isolated DSH instance built from this branch. The source image (`source-tiara.png`, 32×16 pixel art scaled ×8 with 57 colors) stands in for art drawn in another tool.

## Plain PNG import

| Size and color count shown before importing | Keeping 6 colors (nearest color, no dithering) |
| ------------------------------------------- | ---------------------------------------------- |
| ![count](image-count-en-light.webp) | ![reduce](image-reduce-en-light.webp) |

| Imported as fixed colors and worn | Replace color remaps two colors to hair color tones | The saved copy follows a hair color change |
| --------------------------------- | --------------------------------------------------- | ------------------------------------------ |
| ![worn](image-worn-en-light.webp) | ![remap](image-remap-en-light.webp) | ![recolor](image-recolor-en-light.webp) |

## Derived parts

| Mika's wings edited and saved: "Based on another part · based on Mika's part" | A built-in halo opened as a flattened starting canvas |
| ----------------------------------------------------------------------------- | ----------------------------------------------------- |
| ![derived](derived-en-light.webp) | ![built-in](builtin-flatten-en-light.webp) |

## Full flow

![full flow](png-import-flow.gif)

The same recording as video: [png-import-flow.mp4](png-import-flow.mp4)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added docs/assets/pr/1219-png-import/source-tiara.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading