fix(rpgmaker): preserve background art in image translations
- Require clean source-layer discovery and state-aware recomposition - Protect faint artwork from opaque covers and blurred text remnants - Validate representative progression states before rendering full batches
This commit is contained in:
parent
56453e922b
commit
f5e8cdcbf2
1 changed files with 101 additions and 14 deletions
|
|
@ -24,6 +24,11 @@ folder. Do not modify runtime game images or any other project files; the Image
|
|||
patch validated edits later. Store backups and temporary candidates outside the editable image
|
||||
folder so they cannot be mistaken for patchable assets. Work through all editable PNGs without
|
||||
asking for confirmation unless a hard safety rule below requires review.
|
||||
|
||||
Runtime assets may be read, decoded, or decrypted in memory or into an isolated temporary
|
||||
directory when needed to reconstruct an editable image. This does not authorize modifying those
|
||||
runtime assets. Prefer the project's own clean source layers over attempting to recover artwork
|
||||
from a flattened text-bearing PNG.
|
||||
</task_context>
|
||||
|
||||
Translate embedded bitmap text by reconstructing the smallest safe UI regions and rendering
|
||||
|
|
@ -40,6 +45,8 @@ Produce localized images that:
|
|||
- Preserve empty spaces used for runtime-drawn values.
|
||||
- Fit translated text without clipping or collisions.
|
||||
- Preserve the distinct visual language and emphasis of every text role.
|
||||
- Preserve meaningful background illustrations, including faint watermarks and art visible only
|
||||
through a translucent reading surface.
|
||||
- Retain recoverable originals.
|
||||
- Include a concise validation report.
|
||||
|
||||
|
|
@ -80,13 +87,41 @@ Record:
|
|||
- The visual treatment of each text role: font character, weight, fill or gradient, outline,
|
||||
shadow, inner or outer glow, bloom, blur, opacity, offset, and antialiasing.
|
||||
- Whether each label is freestanding over the artwork or contained by an existing panel.
|
||||
- Whether a panel contains faint, translucent, partially obscured, or progression-dependent
|
||||
artwork beneath its text.
|
||||
|
||||
Create a contact sheet when multiple variants share a layout. View each target at original
|
||||
resolution before choosing coordinates. Treat distinctive effects as required design constraints,
|
||||
not optional decoration. A luminous pink title, for example, must remain luminous and pink; flat
|
||||
white text or a newly invented dark pill is not an equivalent treatment.
|
||||
|
||||
### 4. Inspect runtime drawing logic
|
||||
Do not decide that a low-contrast region is blank merely because its artwork is subtle. Compare
|
||||
contrast-enhanced views when necessary, and inspect representative pages from the beginning,
|
||||
middle, and end of each image sequence. Memo, codex, gallery, and recollection pages commonly
|
||||
change from a neutral enemy icon on early pages to unlocked scene artwork on later pages.
|
||||
|
||||
### 4. Locate clean artwork and source layers
|
||||
|
||||
Before choosing any removal method for text over artwork, search the read-only project for a
|
||||
clean version of every covered visual element. Check:
|
||||
|
||||
- Runtime images with matching prefixes, encounter numbers, abbreviations, or character names.
|
||||
- Enemy battlers, recollections, cut-ins, gallery images, portraits, and layered battle sprites.
|
||||
- Alternate pages or variants that reveal how the same composition is assembled.
|
||||
- Event and script references that map an editable filename to a runtime encounter or asset.
|
||||
- RPG Maker encrypted image files. Read the project encryption key and decode a copy in memory
|
||||
or a temporary directory when required; never alter the encrypted original.
|
||||
|
||||
Build an explicit mapping from each editable variant to its clean source art. Preserve semantic
|
||||
and progression differences: for example, use the enemy icon on introductory pages and the
|
||||
matching recollection illustration only on pages where that illustration is meant to appear.
|
||||
Confirm the mapping against the flattened source visually; filenames and numbering alone are not
|
||||
proof. Do not substitute a later unlocked image merely because it is easier to obtain.
|
||||
|
||||
If a clean source layer exists, reconstruct the composition from that layer. Do not mask, blur,
|
||||
clone over, or cover the flattened artwork first.
|
||||
|
||||
### 5. Inspect runtime drawing logic
|
||||
|
||||
Search the read-only game project for every image filename and the code or event data that
|
||||
displays it. Determine:
|
||||
|
|
@ -101,7 +136,7 @@ Treat runtime value locations as protected keepout regions. Do not bake values i
|
|||
If runtime behavior cannot be established, preserve suspicious blank areas and report the
|
||||
uncertainty.
|
||||
|
||||
### 5. Transcribe and translate
|
||||
### 6. Transcribe and translate
|
||||
|
||||
List each visible source string with its role and location. Use this precedence:
|
||||
|
||||
|
|
@ -120,7 +155,7 @@ Preserve:
|
|||
|
||||
Do not rely on OCR alone. Verify OCR output visually, especially for stylized Japanese fonts.
|
||||
|
||||
### 6. Classify the background
|
||||
### 7. Classify the background
|
||||
|
||||
Choose the least destructive valid removal method.
|
||||
|
||||
|
|
@ -132,13 +167,16 @@ Choose the least destructive valid removal method.
|
|||
| Simple gradient | Interpolate or clone a clean patch |
|
||||
| Repeating texture | Clone a nearby matching region |
|
||||
| Bokeh/noisy field | Clone and feather a clean patch |
|
||||
| Text over artwork | Use a precise mask only when safe |
|
||||
| Text over cleanly sourced artwork | Rebuild from the clean art layer, then render text |
|
||||
| Text over flattened artwork only | Use a precise mask only when demonstrably safe |
|
||||
| Text crossing a character | Skip and report unless the user supplies a safe method |
|
||||
|
||||
Prefer whole-panel reconstruction for structured UI. It avoids blurred remnants and
|
||||
source-glyph ghosts.
|
||||
source-glyph ghosts. However, an art-bearing reading surface is not a disposable flat panel.
|
||||
Whole-panel reconstruction is valid there only if every meaningful illustration and decoration
|
||||
is restored from clean sources with the correct placement, opacity, and page-specific state.
|
||||
|
||||
### 7. Define an explicit layout
|
||||
### 8. Define an explicit layout
|
||||
|
||||
For each reconstructed panel, record its bounds, corner radius, fill color, opacity model,
|
||||
border, and shadow.
|
||||
|
|
@ -151,10 +189,13 @@ from the source and reproduce multi-layer effects in separate deterministic pass
|
|||
For each protected region, record its bounds and required policy: pixel-identical, no text, or
|
||||
no overlap.
|
||||
|
||||
For each reconstructed background illustration, also record its clean source path, crop, scale,
|
||||
anchor, opacity, compositing order, and the page or state in which it is allowed to appear.
|
||||
|
||||
Do not improvise coordinates independently for images that share a template. Define a base
|
||||
layout and apply only variant-specific overrides.
|
||||
|
||||
### 8. Reconstruct panels
|
||||
### 9. Reconstruct panels
|
||||
|
||||
Use sampled colors from the original panel when practical. Account for how the game displays
|
||||
the asset:
|
||||
|
|
@ -167,12 +208,26 @@ Replace enough of the panel to remove every source glyph. Avoid semi-transparent
|
|||
leave source text visible beneath them. Do not cover frame borders, portraits, or unrelated
|
||||
decoration.
|
||||
|
||||
When a reading surface contains background art, rebuild in this order:
|
||||
|
||||
1. Reconstruct the clean paper, card, gradient, or texture.
|
||||
2. Composite the correct clean enemy icon or illustration at its source-equivalent crop, scale,
|
||||
position, and opacity.
|
||||
3. Restore safe borders and decorations from clean sources or protected source crops.
|
||||
4. Render the translated text last.
|
||||
|
||||
Do not use an opaque wash to hide source text if it also hides a meaningful illustration. Do not
|
||||
use a blurred copy of the flattened source as an underprint: blurred glyphs remain glyph-shaped
|
||||
and the illustration loses detail. Chroma masks and glyph masks are fallback techniques, not a
|
||||
substitute for source-layer discovery; reject them if outlines, halos, or tinted glyph fragments
|
||||
remain at original resolution.
|
||||
|
||||
Preserve the original relationship between text and background. Do not add a backing rectangle,
|
||||
pill, card, or heavy shadow when the source text was freestanding. Reconstruct the background
|
||||
behind the old glyphs, then render the translation with an equivalent outline, glow, bloom, and
|
||||
layering. Only rebuild a panel when that panel was already part of the source design.
|
||||
|
||||
### 9. Fit typography
|
||||
### 10. Fit typography
|
||||
|
||||
Use real font metrics. Fit text in this order:
|
||||
|
||||
|
|
@ -189,19 +244,27 @@ asset. Preserve character-name colors and other meaningful visual distinctions.
|
|||
font is unavailable, choose the closest font by shape and weight, but still match the original
|
||||
effect stack and visual prominence.
|
||||
|
||||
### 10. Protect dynamic values
|
||||
### 11. Protect dynamic values
|
||||
|
||||
Reserve the exact runtime-drawn areas discovered from source code or event data. Test likely
|
||||
maximum values such as `0`, `99`, `100`, `999`, and any known project-specific maximum. Ensure
|
||||
translated labels and suffixes cannot collide with right-aligned or centered runtime values.
|
||||
|
||||
### 11. Render candidates
|
||||
### 12. Render representative candidates first
|
||||
|
||||
Render from the verified original or backup, never from an earlier candidate. Prefer a
|
||||
deterministic raster backend such as ImageMagick, Pillow, OpenCV, or Skia. Keep operations
|
||||
explicit and repeatable.
|
||||
|
||||
### 12. Validate before installation
|
||||
Before rendering the full batch, render and inspect at least one representative of every
|
||||
background class, geometry, and progression state. For a multi-page memo set, this normally
|
||||
includes an early icon page and a later illustration page, plus examples whose art is pale,
|
||||
dark, highly saturated, or close to the text color. Do not proceed to the full batch until these
|
||||
samples show all intended artwork and no source glyphs at original resolution.
|
||||
|
||||
After the representative gate passes, render the entire candidate set from the backup.
|
||||
|
||||
### 13. Validate before installation
|
||||
|
||||
Perform all applicable checks:
|
||||
|
||||
|
|
@ -215,6 +278,12 @@ Perform all applicable checks:
|
|||
- Inspect important images at original resolution.
|
||||
- Simulate dynamic values at their runtime coordinates.
|
||||
- Check for clipping, ghosted source glyphs, bad baselines, and collisions.
|
||||
- Confirm that every source background illustration still exists in the candidate and remains
|
||||
recognizable at intended runtime scale.
|
||||
- Confirm that introductory and unlocked pages use the correct state-specific art rather than a
|
||||
single image repeated across all pages.
|
||||
- For reconstructed art, compare source and candidate for subject identity, crop, placement,
|
||||
scale, opacity, compositing order, and visual prominence.
|
||||
- Compare source and candidate side by side at original resolution and at the intended runtime
|
||||
scale. Confirm that glow color, halo footprint, contrast, translucency, and hierarchy retain
|
||||
the same visual role and emphasis.
|
||||
|
|
@ -222,9 +291,13 @@ Perform all applicable checks:
|
|||
darker, brighter, heavier, or more panel-bound than the source.
|
||||
- Verify the candidate came from the original, not another modified output.
|
||||
|
||||
Create contact sheets organized by both template and progression state. A full-set visual sweep
|
||||
is required even when structural and pixel checks pass; hashes cannot detect an illustration
|
||||
that was intentionally but incorrectly covered during reconstruction.
|
||||
|
||||
Do not install a candidate that fails a hard check.
|
||||
|
||||
### 13. Install atomically
|
||||
### 14. Install atomically
|
||||
|
||||
After validation:
|
||||
|
||||
|
|
@ -233,7 +306,7 @@ After validation:
|
|||
- Re-run structural checks on the installed file.
|
||||
- Hash the installed result when reproducibility matters.
|
||||
|
||||
### 14. Report concisely
|
||||
### 15. Report concisely
|
||||
|
||||
Report:
|
||||
|
||||
|
|
@ -249,8 +322,12 @@ Do not paste full image files, large encoded data, or unrelated source code.
|
|||
## Hard safety rules
|
||||
|
||||
- Never alter a portrait or protected artwork merely to make text removal easier.
|
||||
- Never cover, flatten, or discard faint background art merely to simplify source-text removal.
|
||||
- Never treat low contrast or partial transparency as evidence that a region is blank.
|
||||
- Never reveal later progression artwork on earlier pages when the source used a neutral icon.
|
||||
- Never bake runtime counters or percentages into a static asset.
|
||||
- Never use a translucent cover that leaves readable source glyphs beneath it.
|
||||
- Never use blurred source text as a background texture or underprint.
|
||||
- Never assume blank space is unused when project source can be inspected.
|
||||
- Never substitute a font silently when exact layout depends on it.
|
||||
- Never discard a distinctive glow, gradient, outline, shadow, or transparency merely because
|
||||
|
|
@ -265,7 +342,13 @@ Do not paste full image files, large encoded data, or unrelated source code.
|
|||
## Decision rules
|
||||
|
||||
Use whole-panel reconstruction when text is contained in a reproducible UI card, several labels
|
||||
share one panel, or localized inpainting would leave artifacts.
|
||||
share one panel, or localized patching would leave artifacts. If the panel contains meaningful
|
||||
art, whole-panel reconstruction additionally requires a clean source and an explicit art-layer
|
||||
recomposition plan.
|
||||
|
||||
Use clean-layer recomposition whenever flattened text overlaps an illustration and the project
|
||||
contains the enemy, recollection, portrait, cut-in, or layered sprite used to build it. This takes
|
||||
precedence over masks, cloning, blurring, and opaque covers.
|
||||
|
||||
Use localized patch replacement when the background is simple and panel reconstruction would
|
||||
alter too much, or a clean neighboring texture can be cloned safely.
|
||||
|
|
@ -273,6 +356,8 @@ alter too much, or a clean neighboring texture can be cloned safely.
|
|||
Skip and request review when:
|
||||
|
||||
- Text overlaps a character, unique illustration detail, or irregular border.
|
||||
- Text overlaps flattened artwork and no clean source or demonstrably safe deterministic
|
||||
reconstruction is available.
|
||||
- Runtime coordinates cannot be established and collision risk is meaningful.
|
||||
- Translation cannot fit without materially changing meaning.
|
||||
- Alpha behavior is uncertain and the asset is composited at runtime.
|
||||
|
|
@ -286,5 +371,7 @@ Consider the task complete only when:
|
|||
- Protected regions pass their required pixel checks.
|
||||
- Dynamic values have adequate space.
|
||||
- Visual inspection finds no clipping or source-text ghosts.
|
||||
- Every intended background illustration remains present, recognizable, and matched to the
|
||||
correct progression state.
|
||||
- Every translated text role retains the source asset's visual identity and relative emphasis.
|
||||
- Originals remain recoverable.
|
||||
|
|
|
|||
Loading…
Reference in a new issue