Community图像github.com

probably-stolen-character-portraits-public

为像素风游戏角色制作 4× 胸像立绘(1152×844)并接入 SpriteDict:一次生图、抠图、28–30 色量化、2px 描边、PPU 400、Bilinear 无 mipmap。适用于新增/替换顾客或 NPC 形象、同人角色、矮小体型,以及 4× 与 1× 规格换算;生图为强约束(每个角色一次调用,2–3 版里挑一版)。

probably-stolen-character-portraits-public 是什么?

probably-stolen-character-portraits-public is a Claude Code agent skill that 为像素风游戏角色制作 4× 胸像立绘(1152×844)并接入 SpriteDict:一次生图、抠图、28–30 色量化、2px 描边、PPU 400、Bilinear 无 mipmap。适用于新增/替换顾客或 NPC 形象、同人角色、矮小体型,以及 4× 与 1× 规格换算;生图为强约束(每个角色一次调用,2–3 版里挑一版)。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/bilngd/probably-stolen-character-portraits-public/tree/HEAD

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Deep Space Pawn Shop Character Portraits (4× Single-Track · Public Version)

2026-11-19 Scope: Only 4×. 1× exists solely as auxiliary information—retain its values for conversion baseline (288×211 ×4), original 1× busts as style reference, and old 1× finished pieces for comparison; no new 1× images are generated, and no A/B dual versions are produced.

4× three hard scope rules (effective 2026-11-20, generation is a hard constraint):

  1. Generate once, valid forever: Each character is allowed only 1 image_gen call, producing 2–3 candidate variants in a single request; no further calls are permitted for any reason—including "composition too wide," "head too big," "re-adjust the character design," or "generate a supplementary 4× first image."
  2. Pick only from the first batch: The final selection must come only from the images returned by this single call. If unqualified, you may only switch to another variant within the batch or modify crop/conversion parameters; do not regenerate.
  3. No restrictions on mouth expressions: Do not specify lip line thickness, darkness levels, or prohibit half-open mouths or showing teeth; closed mouth, smile, open mouth, big laugh—all follow the character's design requirements.

Tool placeholder names: image_gen refers to your platform's image generation tool (one request yields 2–3 variants); upload_reference is the upload interface that converts local reference images into model-readable URLs/file IDs; image CLI refers to your matting command. Substitute the actual tool names; the process and specifications remain unchanged.

Generation Hard Constraints (Check Each Line Before Generating)

Check ItemMust Be True
Character design lockedIf an existing fan design is available, first gather 2–3 reference images; do not rely on "trying during generation"
Composition sentenceBust-up + lower edge slightly below chest + head 38–40% + top spacing 8% + left/right spacing 8–10%
Long hair / shoulder-lengthWrite "hair strands gathered behind shoulders, not touching left/right edges"; for wide-haired characters, relax to "does not extend beyond shoulder line," width judged by shoulder-line width scope
Reference order1–3 original game busts of same gender, 4–6 original game / fan designs (stop at 5 if only 2 original game images are selected)
Body type targetWrite into prompt, select grade per 4× body type table
Generation countThis character has 0 previous calls; if one already exists, stop immediately and pick from the batch

Violation Determination: Any second image_gen call for the same character, regardless of reason, constitutes a violation and invalidates the draft. Each request produces only 2–3 variants; every extra variant adds cost.

Count Registration (Cross-Session Hard Gate): Before generating, check ref/<character>_gen.log.

  • If the file does not exist → only then is 1 call allowed; immediately after generation, write the date, tool, number of candidates, and the selected file name.
  • If the file already exists → stop immediately, only allowed to pick from the batch pointed to by the log; do not call image_gen again.
  • The log must clearly state batches=1; any occurrence of batches>1 is considered a violation, and the draft must be marked as invalid in the record.

4× Hard Specifications (Check Each Time)

ItemValueRationale
Canvas1152×844288×211 × 4
PPU / pivot400 / (0.5, 0.5)File name with 4x → loader automatically ×4
FilteringBilinear, mipmap off (set by MOD code during Rebuild, not in PNG)Pixel art must not blur when scaled to 0.686×
AlphaOnly 0 / 255 (hard edge)Background alpha 0
Character heightPer body type, 4× table see workflow-hires.md §8; bottom_gap = 0Original 1× 146×162 is just a proportional anchor
Character widthPer body type table; for wide-haired characters, use "shoulder line width" scope, loose strands beyond shoulder line are not counted (see note below §8)Total bbox recorded separately, also subject to "no edge touch + ≤1.15× height" constraint
Horizontal positionCharacter center ≈ x=576Original 1× center 145 → ×4
OutlineUniform 2px #292234thin 1px + add_outline_rings.py 1 adds 1 ring
Color count28–30 colorsAt 4×, 18–24 levels inevitably cause banding
Storage<MOD>/Textures/Items/<key>4x.pngOnly the Items subdirectory allows pixelArt Sprite

4× Body Type Table: The only copy is in references/workflow-hires.md §8; this page does not duplicate it. Selection order: Very petite → Slender → Normal → Tall → Curvy (broad shoulders); the width in the table is shoulder line width.

Width Scope (Revised 2026-11-20): The "4× width" in the table refers to shoulder line / torso width, not the total bbox including loose strands on both sides.

  • Wide-haired female characters (long curly hair, twin tails, big waves, hair volume clearly exceeding shoulder line): Strands beyond the shoulder line are not counted toward width. As long as the following three conditions are all met, the total bbox may exceed the width range in the table:
    1. Strands do not touch edges: Leave ≥8% canvas on each side (≥92px per side for 1152 width); no strand may touch the left or right canvas edge;
    2. Total width has an upper limit: figure total bbox width ≤ 1.15× character height (if exceeded, switch to a narrower variant within the batch, or reduce --height for "extremely wide hair");
    3. No squeeze: Do not use --squeeze to force strands into the table.
  • Determination of shoulder line width for table entry (Normal 480–560 / Slender 400–480 / Broad shoulders 560–620, etc.): Measure the horizontal distance between the outer edges of the left and right shoulder / upper arm (including sleeves, not including strands beyond the shoulder line) on the 4× image; figure still records the total bbox, and ref/<character>_gen.log additionally records body_width=<shoulder line width>.

Composition and Shot Scale: Image Model Bust-Up Mode

  1. Fixed shot scale and crop boundaries: When generating all character images, strictly adopt a bust-up (below chest) medium close-up composition. Leave appropriate headroom at the top; the lower edge must be precisely cropped at just below the chest, near the upper ribcage edge (only showing the head, neck, shoulders, upper arms, and clothing details above the chest); strictly avoid pulling back to the waist, abdomen, or full body.

  2. Prompt auto-append sentence (include in every generation prompt, at beginning or end):

    Bust-up portrait composition, medium close-up shot, frame from top of head to just below chest precisely cropped, focus on facial expression, shoulder and neck lines, and details of chest collar and accessories; waist and lower body parts do not appear.

    For the regular version with background, include this sentence; when using templates from workflow-hires.md, do not omit or rephrase.

  3. Limb movement restraint: To prevent the model from pulling back the shot to accommodate large movements, prohibit writing actions like hands on hips, in pockets, large arm waving, or showing lower body movements; actions must only fall within the shoulder and chest height range (actions must conform to the character design).

Single Process (8 Steps)

  1. Reference images: 3 original game busts of same gender (<gender>Upper_4/6/9_full.png) + 2–3 original game designs (total 5–6 images, if only 2 original game images are selected, no image 6); save to <MOD>/ref/, use upload_reference to upload and get URLs.
  2. Single generation (hard constraint): First check ref/<character>_gen.log; only if it does not exist may a call be initiated. Use image_gen, image model, 5–6 references (1–3 original game, 4–6 original game designs); copy template from workflow-hires.md §1.5②. One request yields 2–3 candidate variants; do not write any mouth/lip constraints. After this call, no further images may be generated for this character, and immediately write batches=1 log.
  3. Select first image (only within batch): From the 2–3 variants returned, pick the one with the best composition, face, and clothing; it becomes the character baseline. No new batch, no prompt retry allowed.
  4. Matting: image CLI image remove-image-background --scene general (do not use human).
  5. Determine body type: For normal characters, use --height = min(target height, width upper limit / aspect) − 1; for wide-haired female characters, follow the shoulder line width scope (outer strands not counted toward width), and set --height directly based on the target grade; see workflow-hires.md §8 below. Do not use squeeze to alter body type.
  6. Color palette: references/palettes/<character>_4x.json, 28–30 colors, 6–7 levels for hair/clothing/skin each, 2–3 levels for eyes, 1 level for outline.
  7. Conversion: convert_character.py --canvas 1152x844 --palette <character>_4x.json --squeeze 1.0 --outline-mode thin --despeckle 7 → add_outline_rings.py 1.
  8. Validation and placement: alpha [0,255], 28–30 colors, edge_bad 0, body_width (shoulder line width) falls within the width range in workflow-hires.md §8, figure height falls within grade, center_x ≈ 576, bottom_gap 0; copy to Textures/Items/<key>4x.png, sync dist if needed. For integration, use Rebuild per workflow-integrate.md (PPU ×4, FullRect, Bilinear), do not inject directly into mod.Sprites.

Supreme Principle: First Image Defines the Character, Conversion Only Preserves Fidelity

  • First image = the one selected from the first batch: Face shape, facial proportions, hair color, clothing outline are all based on it. Any subsequent adjustments should not change the character into "another version."
  • Do not generate a second first image for 4×: A second generation almost certainly changes the face; the clarity allowed by 4× comes from the 1152×844 canvas itself, not from regeneration.
  • Select variants by only three criteria: Composition (head ratio, shoulder line, lower crop), face (features and expression), clothing/accessory outline. No need to check resolution—all candidates are sufficient for 4×.
  • Conversion phase only preserves fidelity: Scaling, palette, alpha binarization, 2px outline, edge tightening. 4× compression ratio is about 1/2, far less loss than 1×, but cannot alter facial feature shapes or expression.
  • When details are lost, categorize first: If the first image didn't have them (insufficient information) → switch to another variant in the first batch; if the first image had them but conversion quantized them away (insufficient color levels) → add palette slots, adjust --height, swap palette, do not regenerate the image.
  • Do not regenerate for "style unification": Different characters naturally have different faces; as long as 4× specifications are compliant, let each keep its own appearance.

Rework Gate: No Regeneration Allowed (2026-11-20 Hard Constraint)

Each character has only one generation opportunity; rework equals zero tolerance. Measurements are only used to decide which variant to pick from the batch, not as a reason for regeneration.

  1. Measure first, then decide: Run scripts/measure_head.py <png>, or side-by-side with an existing 4× image on the same base. Existing female 4× images have a canvas head-to-total ratio of about 37–44% (DeepSeek example 43.2%; scope = top of hair to chin / canvas 844). Falling within 36–45% canvas / 46–58% figure is normal for in-game use.
  2. "38–40%" is a composition instruction, not a validation ruler: Using it to judge the character bbox will incorrectly disqualify valid images (actual testing shows multiple characters at 57%+).
  3. Three conditions do not constitute reasons for regeneration: Canvas head ratio >46%, width/aspect exceeds body type table, facial features are cropped—even if all three hold simultaneously, only "switch to another variant within the batch" or "modify crop / use broad shoulder grade" is allowed; no supplementary versions, no new batch. For wide-haired characters, first use the shoulder line width scope for review (see workflow-hires.md §8 below): strands beyond the shoulder line being wide does not mean exceeding the table; only if the shoulder line width also exceeds the table / strands touch edges / total width >1.15× height should you need to adjust.
  4. Do not rework based on a single image's visual impression: Previously, a character had 3 extra draft versions generated because it "looked with a big head," but the final selection was still the first batch version; on the same day, another character had 3 batches totaling 8 images generated for "shoulder width exceeding table," with 7 draft versions discarded.
  5. If truly unsalvageable, let the user decide: When all images in the first batch are unqualified, present the 2–3 variants side-by-side with measurements to the user for "which version to use / change character," do not independently regenerate.

Expressions and Highlights (4×, No Expression Restrictions)

  • No expression restrictions: Closed-mouth smile, flat mouth, pout, open mouth, big laugh, showing teeth—all are allowed as per character design; do not write lip line pixel thickness, darkness levels, prohibit half-open mouth, prohibit showing teeth, or downsampling self-checks—that system only served the now-discontinued 1×.
  • Express emotion through eyebrows, eye corners, mouth corners, and the whole face, not as lip dimension requirements.
  • Highlights must be same color family: Only take 1–2 levels brighter than the base color within the same color family; skin highlights from skin palette only, hair highlights from hair palette only, clothing highlights from clothing palette only; at least 8px clusters (at 4× scale), do not use cross-color bright spots, white dots, or isolated highlights.
  • If the final image's expression is unreadable: First go back to references/workflow-hires.md §1.5③ (select first image) and switch to another candidate variant; 4× does not do pixel-level mouth rework, nor do manual mouth drawing.

1× Auxiliary Information (No Longer Produced)

1× now has only three uses:

  1. Specification conversion: Values like 288×211, figure 160, center_x 144, when ×4, become the 4× targets.
  2. Reference images: Original femaleUpper_*_full.png / maleUpper_*_full.png are used to set style, composition, and palette.
  3. Old finished pieces for comparison: Existing 1× PNGs can be viewed side-by-side with 4× at world size, but are not delivery or rollback requirements.
  • Do not run 1× conversions, do not produce A/B versions, do not keep <key>.png for new characters. Old files may be retained, but they do not belong to the delivery.
  • The old 1× process (lip specialization, downsampling self-check, A/B dual versions, mouth rework) is discontinued; do not execute it in the normal workflow. This package only retains the 4× single version.

Example Character (DeepSeek)

CharacterIdentifying FeaturesPalette
DeepSeekBlue-white color scheme + whale tail elementfemale_deepseek_4x.json
  • 4× finished piece: assets/example_deepseek_4x.png (1152×844)
  • 1× reference: assets/example_deepseek_1x.png (288×211, for specification reference only)
  • Rights notice: The DeepSeek name and image belong to their respective owners; this is only a process example. Confirm authorization before external distribution or commercial use.

For new characters, create <character>_4x.json in references/palettes/; no need to update this table.

Read by Task (No Full Read-Through)

TaskRead These
Create a new character / produce 4× portraitworkflow-hires.md §1.5 "Standard Process" (copy exactly)
Create a fan character with an original game designworkflow-fan-character.md (only take reference selection and character description writing; 1× lip section is deprecated) → workflow-hires.md §1.5 → workflow-integrate.md
Create a very petite / young adult characterworkflow-petite-character.md (body type per 4× ×4) → workflow-hires.md §1.5
Have original game images, only need reference extractionworkflow-extract.md
Only integrate an existing PNG into the gameworkflow-integrate.md
Check source code rationale / pool rules / gender determinationspec.md
Select 4× color paletteworkflow-hires.md §4; files in references/palettes/
1× historical scope (A/B, lips, downsampling)Do not read; 1× is discontinued

Common Fatal Pitfalls

PitfallPhenomenonCorrect Approach
Still converting a version for 1×An extra round of rework; 1× is discontinuedOnly deliver 4×; 1× is only for conversion and reference
Generating a separate first image for 4×Second generation changes the face; the two are not the same personOnly 1 generation per character, pick one from the first 2–3 variants
Starting another batch when the first is unsatisfactoryWaste 5–8 images, face still mismatchedOnly switch variants within the batch, or modify crop/conversion parameters; do not regenerate
Thinking "head too big/wide" and regenerating a batchWaste 3 images' worth of credits; final selection still the first batch versionOnly switch to another variant within the batch; 36–45% canvas is normal; if too wide, use broad shoulder grade
Using 38–40% to judge character bboxMultiple characters' normal state incorrectly judged as invalid; rework changes faces38–40% is a composition instruction; bbox 46–58% is normal
Writing mouth-specific sentences for 4×Mouth drawn as thick, hard arcs; expression stiff4× does not restrict expressions; do not write lip line thickness/darkness/prohibit half-open mouth
Doing A/B for 4×Produces an extra useless version4× only produces a single version
Using item icon specifications16×16 or forced multiples of 16Portrait 1152×844; character per 4× body type table
Background alpha=1 / opaqueSolid rectangle around the characterPure dark teal #1A2A33 flat base + matting tool general
Reference images include backgroundGenerated image corners have alpha=255Do not retry generation; directly dark teal base + matting tool general matting, or switch variant within batch; do not use color key
Small character with normal sizeA 24-year-old looks like an elementary school student but is made 640+ tall, 560+ wideUse 4× petite grade 500–580 / 340–420; first read workflow-petite-character.md
Forcing wide shoulders / long bodyBroad-shouldered burly man or long-necked paper dollSet body type per character design; do not use squeeze to alter body type
Wide-haired character judged by total bboxLower height repeatedly, or squeeze to compress strandsUse shoulder line width scope: strands beyond shoulder line are not counted for width; only check "no edge touch + total width ≤1.15× height"
4× using 18–24 colorsColor banding, clothing dead white, hair a blobRe-measure with original image and create a 28–30 color palette
4× skipping quantization / binarizationTens of thousands of colors, hundreds of alpha levels, gray edgesUse convert_character.py --canvas 1152x844; do not use illustration scripts
Outline added to 4pxLooks like a pasted-on black frame (rejected in testing)2px: thin + add_outline_rings.py 1
Composition left to the modelHead takes up 60%, aspect exceeds limitsWrite head ratio and margins into prompt; derive height from aspect, do not squeeze
Shot pulled back to waist/abdomen/full bodyCharacter smaller, face shrunken, aspect widerEvery time include the full sentence "Bust-up portrait composition… waist and lower body parts do not appear"; do not write actions like hands on hips, in pockets, waving, or lower body
4× enabling mipmapPixels blurred into illustrationBilinear, mipmap off
Upscaling a 288 finished piece as 4×Just enlarging blocksMust re-convert from a high-resolution first image
Placing in Textures/ rootThat path has mipmap on, pixelArt=false, making it blurrierAlways place in Textures/Items/

Resources

  • scripts/extract_portraits.py — Extract original game portrait full frames + bbox
  • scripts/convert_character.py — 4× conversion (--canvas 1152x844)
  • scripts/add_outline_rings.py — 2px finalization (thin 1px + 1 ring)
  • scripts/measure_head.py — Head ratio quick measurement (canvas / figure two scopes; use --chin when neck exposed or bangs cut off)
  • scripts/measure_body_width.py — Shoulder line width quick measurement for wide-haired characters (central / span / outer strands row by row; body_width takes central of the shoulder row)
  • scripts/palette_preflight.py — Palette precheck (check for missing eye whites / main color slots, insufficient levels)
  • references/workflow-hires.md — 4× only standard process: §1.5 (8 steps, copy prompt), composition, 28–30 colors, conversion, 2px outline, validation, 4× body type table, pitfalls
  • references/workflow-fan-character.md — Fan characters: select reference images, reference order, matting tool matting, write character description per design (1× lip section deprecated)
  • references/workflow-petite-character.md — Very petite / young adult characters (body type per 4× ×4)
  • references/workflow-extract.md / workflow-integrate.md
  • references/spec.md — SpriteDict / ModLoader source code rationale
  • references/palettes/ — 4× <character>_4x.json (28–30 colors); package includes one DeepSeek example
  • This package does not include historical archives; 1× and illustration version workflows are discontinued, do not follow them.

相关技能