MJ::CanvasUtil
Pure-Crystal image compositing helpers built on stumpy. Used by the scenery-strip pipeline to crop tile edges, build inpaint masks, and stitch tiles + generated bridges into one long image.
Constants
Class methods
Build an inpaint mask for a bridge canvas laid out as
[ context_a | gap | context_b ]. White = regenerate, black = preserve.
A feather-pixel gray ramp on each side of the gap softens the seam.
Copy a sub-rectangle out of a canvas.
Fill a gap [gx, gx+gw) by extending each neighbour's facing column across its half of the gap (left column over the left half, right over the right). Preserves vertical structure (horizon, deck) without horizontal smearing — a cleaner seed for reference-image editors than a cross-blend.
Fill a gap [gx, gx+gw) in dst with a per-row linear blend between
left's column left_x and right's column right_x. Gives an inpaint
model coherent pixels to refine instead of an empty hole.
Concatenate canvases left-to-right. Height is the max of the inputs; shorter canvases are top-aligned on a black background.
Paste src onto dst with its top-left at (ox, oy).
Bilinear resize to exactly (w, h). Returns src unchanged if already that size.