Overview
Introduction
This tool overlays an evenly-spaced grid of lines onto a PNG, computed entirely client-side.
It's useful for adding reference guides, pixel-art grids, or print-layout alignment lines directly onto an image.
What Is PNG Grid Drawer?
A grid-drawing tool that paints horizontal and vertical lines at a fixed pixel interval across the image, alpha-blending the chosen line color onto the existing pixels rather than replacing them outright.
The line spacing, thickness, and color/opacity are all configurable.
How PNG Grid Drawer Works
Starting from the top-left corner, the tool draws a vertical line every `cellSize` pixels and a horizontal line every `cellSize` pixels, each `lineThickness` pixels wide.
Each line pixel is composited over the existing pixel using standard alpha blending, so a semi-transparent line color still lets the underlying image show through.
When To Use PNG Grid Drawer
Use it to add a pixel-art reference grid over a sprite for size and alignment checking.
It's also useful for creating a print-layout guide grid directly baked into a design mockup.
Often used alongside PNG Parts Splitter and PNG Multiplier.
Features
Advantages
- Runs entirely client-side; your image never leaves the browser.
- Alpha-blended lines let the underlying image show through instead of being fully occluded.
- Configurable spacing, thickness, and color for a wide range of grid styles.
Limitations
- The grid always starts at the top-left corner (0,0); it can't be offset to align with off-grid content.
- Lines are drawn as hard-edged rectangles, not antialiased, matching this site's other pixel-level effect tools.
Examples
Best Practices & Notes
Best Practices
- Use a lower opacity grid color so the underlying image stays legible through the lines.
- Choose a cell size that evenly divides your image's dimensions for a clean, complete grid at the edges.
Developer Notes
The pure grid-drawing math lives in a lib function operating on a plain Uint8ClampedArray pixel buffer with no DOM dependency, alpha-blending each line pixel with a small local compositing helper rather than simply overwriting existing pixel values.
PNG Grid Drawer Use Cases
- Overlaying a pixel-art reference grid on a sprite
- Adding print-layout alignment guides to a mockup
- Creating graph-paper-style backgrounds
Common Mistakes
- Expecting the grid to start from the image's center — it always starts at the top-left corner.
- Using a fully opaque grid color and being surprised the underlying image is hidden along every line.
Tips
- Combine with the parts splitter tool to preview exactly where a grid split would land before actually cutting the image.
- Use a contrasting grid color for dark images and a darker one for light images to keep the lines visible.