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):
- Generate once, valid forever: Each character is allowed only 1
image_gencall, 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."- 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.
- 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_genrefers to your platform's image generation tool (one request yields 2–3 variants);upload_referenceis the upload interface that converts local reference images into model-readable URLs/file IDs;image CLIrefers to your matting command. Substitute the actual tool names; the process and specifications remain unchanged.
Generation Hard Constraints (Check Each Line Before Generating)
| Check Item | Must Be True |
|---|---|
| Character design locked | If an existing fan design is available, first gather 2–3 reference images; do not rely on "trying during generation" |
| Composition sentence | Bust-up + lower edge slightly below chest + head 38–40% + top spacing 8% + left/right spacing 8–10% |
| Long hair / shoulder-length | Write "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 order | 1–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 target | Write into prompt, select grade per 4× body type table |
| Generation count | This 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_genagain. - The log must clearly state
batches=1; any occurrence ofbatches>1is considered a violation, and the draft must be marked as invalid in the record.
4× Hard Specifications (Check Each Time)
| Item | Value | Rationale |
|---|---|---|
| Canvas | 1152×844 | 288×211 × 4 |
| PPU / pivot | 400 / (0.5, 0.5) | File name with 4x → loader automatically ×4 |
| Filtering | Bilinear, mipmap off (set by MOD code during Rebuild, not in PNG) | Pixel art must not blur when scaled to 0.686× |
| Alpha | Only 0 / 255 (hard edge) | Background alpha 0 |
| Character height | Per body type, 4× table see workflow-hires.md §8; bottom_gap = 0 | Original 1× 146×162 is just a proportional anchor |
| Character width | Per 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 position | Character center ≈ x=576 | Original 1× center 145 → ×4 |
| Outline | Uniform 2px #292234 | thin 1px + add_outline_rings.py 1 adds 1 ring |
| Color count | 28–30 colors | At 4×, 18–24 levels inevitably cause banding |
| Storage | <MOD>/Textures/Items/<key>4x.png | Only 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:
- 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;
- Total width has an upper limit:
figuretotal bbox width ≤ 1.15× character height (if exceeded, switch to a narrower variant within the batch, or reduce--heightfor "extremely wide hair"); - No squeeze: Do not use
--squeezeto 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;
figurestill records the total bbox, andref/<character>_gen.logadditionally recordsbody_width=<shoulder line width>.
Composition and Shot Scale: Image Model Bust-Up Mode
-
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.
-
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. -
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)
- 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/, useupload_referenceto upload and get URLs. - Single generation (hard constraint): First check
ref/<character>_gen.log; only if it does not exist may a call be initiated. Useimage_gen,image model, 5–6 references (1–3 original game, 4–6 original game designs); copy template fromworkflow-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 writebatches=1log. - 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.
- Matting:
image CLI image remove-image-background --scene general(do not usehuman). - 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--heightdirectly based on the target grade; seeworkflow-hires.md§8 below. Do not use squeeze to alter body type. - 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. - Conversion:
convert_character.py --canvas 1152x844 --palette <character>_4x.json --squeeze 1.0 --outline-mode thin --despeckle 7→add_outline_rings.py 1. - Validation and placement:
alpha [0,255], 28–30 colors,edge_bad 0,body_width(shoulder line width) falls within the width range inworkflow-hires.md§8,figureheight falls within grade,center_x ≈ 576,bottom_gap 0; copy toTextures/Items/<key>4x.png, syncdistif needed. For integration, useRebuildperworkflow-integrate.md(PPU ×4, FullRect, Bilinear), do not inject directly intomod.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.
- 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. - "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%+).
- 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. - 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.
- 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:
- Specification conversion: Values like 288×211, figure 160, center_x 144, when ×4, become the 4× targets.
- Reference images: Original
femaleUpper_*_full.png/maleUpper_*_full.pngare used to set style, composition, and palette. - 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>.pngfor 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)
| Character | Identifying Features | Palette |
|---|---|---|
| DeepSeek | Blue-white color scheme + whale tail element | female_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)
| Task | Read These |
|---|---|
| Create a new character / produce 4× portrait | workflow-hires.md §1.5 "Standard Process" (copy exactly) |
| Create a fan character with an original game design | workflow-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 character | workflow-petite-character.md (body type per 4× ×4) → workflow-hires.md §1.5 |
| Have original game images, only need reference extraction | workflow-extract.md |
| Only integrate an existing PNG into the game | workflow-integrate.md |
| Check source code rationale / pool rules / gender determination | spec.md |
| Select 4× color palette | workflow-hires.md §4; files in references/palettes/ |
| 1× historical scope (A/B, lips, downsampling) | Do not read; 1× is discontinued |
Common Fatal Pitfalls
| Pitfall | Phenomenon | Correct Approach |
|---|---|---|
| Still converting a version for 1× | An extra round of rework; 1× is discontinued | Only 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 person | Only 1 generation per character, pick one from the first 2–3 variants |
| Starting another batch when the first is unsatisfactory | Waste 5–8 images, face still mismatched | Only switch variants within the batch, or modify crop/conversion parameters; do not regenerate |
| Thinking "head too big/wide" and regenerating a batch | Waste 3 images' worth of credits; final selection still the first batch version | Only 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 bbox | Multiple characters' normal state incorrectly judged as invalid; rework changes faces | 38–40% is a composition instruction; bbox 46–58% is normal |
| Writing mouth-specific sentences for 4× | Mouth drawn as thick, hard arcs; expression stiff | 4× does not restrict expressions; do not write lip line thickness/darkness/prohibit half-open mouth |
| Doing A/B for 4× | Produces an extra useless version | 4× only produces a single version |
| Using item icon specifications | 16×16 or forced multiples of 16 | Portrait 1152×844; character per 4× body type table |
| Background alpha=1 / opaque | Solid rectangle around the character | Pure dark teal #1A2A33 flat base + matting tool general |
| Reference images include background | Generated image corners have alpha=255 | Do 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 size | A 24-year-old looks like an elementary school student but is made 640+ tall, 560+ wide | Use 4× petite grade 500–580 / 340–420; first read workflow-petite-character.md |
| Forcing wide shoulders / long body | Broad-shouldered burly man or long-necked paper doll | Set body type per character design; do not use squeeze to alter body type |
| Wide-haired character judged by total bbox | Lower height repeatedly, or squeeze to compress strands | Use 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 colors | Color banding, clothing dead white, hair a blob | Re-measure with original image and create a 28–30 color palette |
| 4× skipping quantization / binarization | Tens of thousands of colors, hundreds of alpha levels, gray edges | Use convert_character.py --canvas 1152x844; do not use illustration scripts |
| Outline added to 4px | Looks like a pasted-on black frame (rejected in testing) | 2px: thin + add_outline_rings.py 1 |
| Composition left to the model | Head takes up 60%, aspect exceeds limits | Write head ratio and margins into prompt; derive height from aspect, do not squeeze |
| Shot pulled back to waist/abdomen/full body | Character smaller, face shrunken, aspect wider | Every 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 mipmap | Pixels blurred into illustration | Bilinear, mipmap off |
| Upscaling a 288 finished piece as 4× | Just enlarging blocks | Must re-convert from a high-resolution first image |
Placing in Textures/ root | That path has mipmap on, pixelArt=false, making it blurrier | Always place in Textures/Items/ |
Resources
scripts/extract_portraits.py— Extract original game portrait full frames + bboxscripts/convert_character.py— 4× conversion (--canvas 1152x844)scripts/add_outline_rings.py— 2px finalization (thin1px + 1 ring)scripts/measure_head.py— Head ratio quick measurement (canvas / figure two scopes; use--chinwhen 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_widthtakes 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, pitfallsreferences/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.mdreferences/spec.md— SpriteDict / ModLoader source code rationalereferences/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.