3D Holo Quicksand Collector Card (holo-card-3d · v2.3)
Turn a user-provided image into a standardized 3-layer + relief-depth 3D SAR/UR collector card with holographic foil, flowing quicksand + 3D micro-sequins, metallic bevel frames, optional 1 surgical prop light sweep + 1 analytical SDF motion motif, and a 3-file deliverable bundle.
Workflow
Phase 0: Environment Preflight
Before running pipeline scripts, verify a real Python 3.10+ interpreter (avoid Windows Store WindowsApps aliases) and dependencies (numpy, Pillow with webp_anim, opencv-python) using scripts/check_env.py:
python scripts/check_env.py --workdir <workdir>
If status != "OK", follow the printed recommended_commands (pip install -r requirements.txt or isolated .venv) before continuing.
Phase 1: Inspect Input & Propose Default Plan
- Inspect the user's reference image first (aspect ratio, backdrop type, whether the subject is already polished art, and whether a distinct hero prop exists).
- Classify the user's intent into one of 3 explicit routes (never silently call AI image-gen to redraw a character when the user asked to keep the original artwork):
- Route 1 — Keep Original Artwork (Zero Image Gen): Pixel-faithful local matting via scripts/matte_layers.py (
rgba/green/magenta/blue/solid-> transparent cutout + proceduralbg_presetbackdrop; complex/non-uniform full illustrations or photos default to full-bleed opaque passthroughnone— never auto-running OpenCVgrabcut— preserving 100% original pixels with relief depth, built-in frame, and top-coat craft lamination) +--auto-depth. Works from 1 single image. - Route 2 — Hybrid (Keep Original Subject + Custom BG/Frame, or vice versa): Local pixel cutout for kept layers; generate or accept user-supplied assets only for layers the user wants replaced.
- Route 3 — Reference-Based AI Redraw: Full style transfer, pose redesign, or TCG re-illustration via Track A (built-in imagegen) or Track B (copy-ready prompt pack).
- Route 1 — Keep Original Artwork (Zero Image Gen): Pixel-faithful local matting via scripts/matte_layers.py (
- Propose-Default-First (Low Friction): Do not interrogate the user with a long questionnaire. Infer a sensible default package from the image and present one concise confirmation block covering only impactful choices (skip confirmation if the user already specified preferences or asked you to decide):
- Route: Route 1 (keep original pixels), Route 2 (hybrid), or Route 3 (AI redraw + art style).
- Theme, Palette, Backdrop & Frame:
theme_palette(autoor preset inassets/palettes.json) +bg_preset(celestial_nebula,stained_glass,cyber_grid,ink_wash,pastel_bokeh,obsidian_velvet) + bundled frame (classic_sar_gold,minimal_platinum,cyber_hud_frame,full_art_glass,baroque_arch,eastern_ink,y2k_polaroid,gothic_spirewithframe_tint: "auto") or customfg. - Craft Material, Lighting & Holo:
material_preset(sar_quicksand,acrylic_brick,cracked_ice,etched_foil,matte_velvet,clean_tcg),lighting_preset(gallery_neutral,dramatic_rim,golden_hour,moonlit_prism,soft_pastel), andholo_pattern(starburst,prism_grid,cosmos_waves,cracked_ice,diagonal_foil,diamond_lattice) — all synced 1:1 across HTML/WebP/GIF and live-switchable in the HTML craft popover. - Card Label Visibility (
label_mode):"page_only"(default: clean art-first card face; title/badge in HTML HUD),"on_card"(engraved metallic bottom nameplate visible on HTML, WebP, and GIF), or"hidden". - Optional Polish:
motion_motif(feathers_bubbles,cyber_stars,petals,embers,snowflakes, ornone) andprop_fx(optional — propose ONLY when a clear hero prop such as a staff, sword, skateboard, lantern, or instrument exists).
Phase 2: Acquire Source Layers (<workdir>/01_raw_layers/)
Initialize <workdir>/card_config.json (adapted from assets/card_config.example.json) and <workdir>/01_raw_layers/.
- Route 1 (Zero Image Gen): Copy the original image directly to
01_raw_layers/mid.<ext>. Omitbg,fg, andmid_depthunless the user supplies them —prepare_assets.pyauto-synthesizes the atmospheric backdrop and relief depth and appliesfallback_frame. - Route 2 / Route 3: Read references/prompt-templates.md before generating or handing off prompts.
- Track A (Built-in Image Gen): Generate requested layers (
3:4,>= 1024x1365; native RGBA preferred, else#00FF00green or#FF00FFmagenta when subject contains green). Remember: AI image-gen redraws pixels; use localmatte_layers.pywhenever pixel preservation is required. - Track B (No Image Gen): Deliver tailored copy-ready prompts (1-image zero-gen, 2-image fast, 3-image auto-depth, or 4-image full) with exact target path
<workdir>/01_raw_layers/, then stop and wait for files.
- Track A (Built-in Image Gen): Generate requested layers (
Phase 3: Matte, Asset Lint & Fast Preview Gate (Before Slow Render)
Run matting, asset preparation, and the ~3-second 2-angle composite preview BEFORE running the multi-minute 84-frame WebP/GIF encode:
python scripts/run_pipeline.py --workdir <workdir> --stage matte
python scripts/run_pipeline.py --workdir <workdir> --stage prepare
python scripts/run_pipeline.py --workdir <workdir> --stage preview
Inspect all pre-render gates and address any LINT WARNING printed by prepare_assets.py:
03_processed/cutout_check.png: For transparent/chroma/solid cutouts, verify clean edges and zero green/magenta/white fringe. For full-bleed complex-background inputs (mid_mode == none), confirm original artwork is preserved cleanly without unintended cropping.03_processed/align_check.png&asset_lint: Check forEDGE_CLIPPING_TOP/SIDE(clipped ears, head, or props —mid_fit: "auto"switches non-3:4 inputs tocontain_safeautomatically, or adjust source headroom), face-box placement, and relief depth contour.03_processed/preview_composite.png: Shows0°front + tilted holo + transparent checkerboard in ~3s. Confirm framing, palette, andon_cardnameplate legibility (show preview to the user before full animation render when visual sign-off matters).
Phase 3.5: Optional Surgical prop_fx ("1+1 Restraint Rule")
Only run when prop_fx.enabled is desired for a hero prop (never add outer card shells, background energy veins, hair UV wobble, or circular flashbangs):
- Export labeled
0.05UV coordinate rulers (--crop U0 V0 U1 V1optional):python scripts/run_pipeline.py --workdir <workdir> --stage prop-grid - Record tight
mask_polygons, fingerexclude_polygons,start_uv, andtip_uvincard_config.json, then rebuild mask and inspect03_processed/prop_mask_qa.pnguntil zero bleed touches skin/face/hair:python scripts/run_pipeline.py --workdir <workdir> --stage prop-mask
Phase 4: Full Build, Render & Separated Technical / Visual QA
python scripts/run_pipeline.py --workdir <workdir> --stage html
python scripts/run_pipeline.py --workdir <workdir> --stage render
python scripts/run_pipeline.py --workdir <workdir> --stage verify
Always separate Technical Verification from Visual QA in your delivery report:
- Technical Verification (
scripts/verify_outputs.py): Confirm exit code0and"technical_status": "PASS"(validates HTML WebGL2 bundle, WebP690x960/84f/60ms/dispose=1, no_blend=1/ transparent corners, GIF460x640/84f/60ms). - Visual QA (Manual/Agent Inspection): Inspect
03_processed/qa_keyframes.png(andcutout_check.png/prop_mask_qa.png) and explicitly report visual checks (cutout edges,no ear/limb clipping,contrast/lighting,on_card text readabilityif enabled) plus anyasset_lint_warningsor items not visually checked.
Phase 5: Deliver 3-File Bundle (<workdir>/output/)
State accurate per-format frame rates explicitly on delivery:
holographic_card.html— Offline single-file60 fpsWebGL2 interactive 3D card (5.2sauto-orbit,±30°/±19°drag & gyro,流畅/高清toggle).holographic_card.webp—690x960transparent RGBA animated WebP (84frames @60 ms/frame≈16.7 fps,5.04s, zero-ghostingdispose=1, no_blend=1).holographic_card.gif—460x640themed studio-backdrop GIF (84frames @60 ms/frame≈16.7 fps,5.04s, 256-color Median Cut + Floyd–Steinberg).
Bundled Files & References
- Scripts (
scripts/):check_env.py,run_pipeline.py,matte_layers.py,build_prop_mask.py,prepare_assets.py,build_html_card.py,render_card.py,verify_outputs.py. - Assets (
assets/):palettes.json,card_config.example.json,frames/{classic_sar_gold,minimal_platinum,cyber_hud_frame,full_art_glass,baroque_arch,eastern_ink,y2k_polaroid,gothic_spire}.png; pinned deps in requirements.txt. - References (load on demand):
- references/prompt-templates.md — Route 2/3 prompt templates & cutout-vs-redraw rules.
- references/standard-spec.md — Optical/motion specs,
card_config.jsonschema, lint thresholds, and QA invariants.