MJ::PixelSpec
Inherits YAML::Serializable < Reference < Object
Config for a pixel-art restyle. Lives as pixel.yml beside an image.png.
Run: mj pixelize <dir> -> writes redraw.png (raw AI) + pixel.png (final).
The look ("8-bit" vs "16-bit") is driven by style, which selects a prompt template —
Nano Banana 2 (google:4@3) infers pixel density and palette from the era name. width/
height set the CANVAS size, not the pixel granularity.
snap and background are independent optional post-passes:
- snap: downscale to a true
grid+ quantize tocolors+ nearest upscale, for pixel-perfect authenticity. Off by default — the raw AI redraw already reads as pixel art. Requires ImageMagick (magick) on PATH. - background: "transparent" keys out a flat magenta chroma field (prompted for and removed); "keep" leaves the AI's background; "#RRGGBB" requests a solid colour bg.
Constructors
Instance methods
Sample the actual rendered corner colour instead of keying the known magenta. Default FALSE: the redraw is prompted for flat #FF00FF, and corner-sampling can grab a floor/subject colour that reaches a corner (then the magenta never keys — leaving an opaque magenta field). Only set true if a model renders an off-magenta field but with clean, subject-free corners.
Sample the actual rendered corner colour instead of keying the known magenta. Default FALSE: the redraw is prompted for flat #FF00FF, and corner-sampling can grab a floor/subject colour that reaches a corner (then the magenta never keys — leaving an opaque magenta field). Only set true if a model renders an off-magenta field but with clean, subject-free corners.
Restrict defringe to this many px of a transparent pixel. Default 2 (edge shell only) so legitimately magenta/pink pop-art colours in the SUBJECT interior are left alone.
Restrict defringe to this many px of a transparent pixel. Default 2 (edge shell only) so legitimately magenta/pink pop-art colours in the SUBJECT interior are left alone.
Transparent-background keying (only when background == "transparent"). Routed through the PROP keyer so edges get despilled and transparent pixels solidified — otherwise a magenta fringe outlines the sprite and resurrects when it's downscaled. Distance-from-magenta ramp (per-channel max, 0..255): below key_low = transparent, above key_high = opaque.
Transparent-background keying (only when background == "transparent"). Routed through the PROP keyer so edges get despilled and transparent pixels solidified — otherwise a magenta fringe outlines the sprite and resurrects when it's downscaled. Distance-from-magenta ramp (per-channel max, 0..255): below key_low = transparent, above key_high = opaque.