stencilIPV
Description
stencilIPV is a specialized variant of stencil designed for Magdy Halimβs multi-plane .ipv image files (which begin with a 2048-byte header followed by -planes <n> sequential 8-bit image planes stored in bottom-to-top row order).
CLI Options & Usage
stencilIPV -mask <mask.8bit> -in <in.ipv> -out <out.ipv> \
[-planes <n>] [-inverse] [-ignore <val>] \
[-under <under.ipv> | -undercolor <val>]
-mask <mask.8bit>: 8-bitOMG1(JHC_header) mask file (whosexmax Γ ymaxdimensions define the plane dimensions).-in <in.ipv>: Input.ipvmulti-plane file (2048-byte header +planes Γ xmax Γ ymaxbytes).-out <out.ipv>: Output stenciled.ipvfile.-planes <n>: Number of image planes in<in.ipv>(default:1).-inverse: Reverses the mask selection logic.-ignore <val>: Mask pixel value treated as masked out (default:0).-under <under.ipv>/-undercolor <val>: Underlay.ipvfile or constant byte value (default:255) placed in masked regions.
Algorithm
- Reads the
OMG1mask from<mask.8bit>and flips its rows vertically (flipped_mask[i, ymax - 1 - j] = mask[i, j]) to match the bottom-up coordinate orientation of.ipvfiles. - Copies the 2048-byte
.ipvheader from<in.ipv>to<out.ipv>, then loops through all0 .. planes-1planes, applying the flipped mask to select either<in.ipv>or<under.ipv>/undercolorfor each pixel.