Skip to content

Authors

Avatar

Muhammed Midlaj N

Software Developer

Page cover

Gerber2PNG

The Problem

In the workshop at the FabLab in Kerala, makers often bring PCB designs made in KiCad, Eagle, Altium, Fusion 360, EasyEDA, Proteus, and so on. To mill PCBs using Mods (or similar milling/CAM tools), the raw Gerber files must be converted into black & white PNGs: one image each for the traces (copper), for the board outline and drill holes, etc.

Doing this conversion manually is:

  • Tedious — many steps each time.
  • Error-prone — layers might be swapped, alignment off, blank output, etc.
  • Time-consuming and requires someone familiar with export settings.

So the makers thought: let’s build a tool to streamline this.

The solution: Gerber2Png

Gerber2Png is a browser-based application (built with React / JavaScript) that lets you upload the necessary Gerber files and get back PNGs (monochrome) ready for PCB milling. ([GitLab][1])

Key features:

  • Supports Gerber files exported from many EDA tools (KiCad, Eagle, Fusion 360, Proteus, Altium, EasyEDA) ([GitLab][1])
  • Handles both single-sided and double-sided PCBs ([GitLab][1])
  • Produces separate images: traces, drill holes, outline etc., as needed ([GitLab][1])
  • Has a user-friendly UI so even beginners can convert without knowing all export details. ([GitLab][1])

How it works (behind the scenes)

Here’s the process, or what has to happen, more or less:

  1. Export Gerber files properly from your EDA These need to include: copper layers (top, bottom if any), drill files, outline/profile, etc. Also choices like units, zeros, origin point, y-axis mirroring etc., must be set correctly. (If not, output may be blank or misaligned.) From similar tools’ instructions: In KiCad, you set origin (auxiliary), choose Plot → Gerber, select copper & edge-cut layers, enable “use auxiliary axis as origin”, generate drill file, etc. ([GitHub][2])

  2. Upload Gerber files into Gerber2Png via its web interface. The UI guides you to select whether it’s a single layer, double layer, etc. ([GitLab][1])

  3. Conversion pipeline

    • Parsing of the Gerber files
    • Rasterizing the vector Gerber contents
    • Applying masks or combining layers appropriately (trace vs hole vs outline)
    • Generating monochrome PNG images
  4. Download output PNGs ready for milling tools (Mods or whatever) to process. ([GitLab][1])

Best practices & troubleshooting

To get reliable results, the following must be taken care of:

What can go wrongWhy it happensWhat to do
Blank PNG / no traces visibleGerber export had wrong layers, missing copper, origin wrong, or invalid formatDouble-check export settings; use viewer to verify Gerber file first
Misaligned top and bottom layers (for double-sided)Mirroring or origin not consistent among layersEnsure origin and axis settings are same; align via auxiliary origin point etc.
Large file size or slow conversionVery fine details, many polygons, very high resolution requestedTry lowering resolution; simplify polygons; only include needed layers
Unsupported Gerber flavor / commandsSome exports use odd/non-standard variationsUse standard Gerber (RS-274X etc.) if possible; test with small sample

Origins & credit

  • Developed / seen in use at SuperFabLab Kerala by folks like Midlaj, Saheen Palayi, guided by Jogin Francis. ([GitLab][1])
  • Licensed under MIT License. ([GitLab][1])
  • The need came from local makers / startup clients submitting Gerber exports from varied EDA tools. The lab needed consistent milling-ready PNGs. ([GitLab][1])

Technical dependencies & specification pointers

  • Depends on parsing Gerber format(s) correctly. Knowledge of Gerber specification (RS-274X, possibly Gerber X2) is crucial. ([Ucamco][3])
  • Some tools like the earlier gerber2png.py from GitHub convert Gerber files output from KiCad into two PNGs: one for copper traces, another for holes + outline. ([GitHub][2])
  • You need to decide image resolution, scaling, possibly padding or offsets to match the milling tool’s expectations.

The user story

To illustrate:

Imagine Sarah has just finished designing a double-sided PCB in KiCad. She needs to send it to the FabLab milling machine that requires PNGs for both layers and one outline file. Previously, she had to export multiple Gerber files, open them in a viewer, rasterize them, fiddle with alignment, fix blank/missing features — it took 30+ minutes and mistakes often crept in. With Gerber2Png, Sarah uploads her Gerber files, selects “double-sided”, clicks convert, downloads clean monochrome PNGs, and in 5 minutes her files are milling-ready. She even double-checks with the generated outline image to ensure everything is aligned. Confidence high, time low.

Summary

Gerber2Png is a helpful bridge between PCB design tools (which export Gerber) and PCB fabrication tools (which often expect raster images). It reduces manual effort, reduces errors, and speeds up fabrication workflow.

Authors

Avatar

Muhammed Midlaj N

Software Developer