Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.

How to Convert Gerber to PNG/JPG Images: Complete Guide for PCB Visualization

Every PCB designer eventually needs to share their board design with someone who doesn’t have CAM software installed. Maybe it’s a client who wants to see what they’re paying for, a blog post showcasing your latest project, or documentation for your GitHub repository. Whatever the reason, knowing how to convert Gerber to PNG or JPG images is an essential skill that saves time and eliminates the “can you just send me a picture?” requests. This guide covers everything from quick online conversions to high-resolution exports for professional documentation.

Why Convert Gerber Files to PNG or JPG?

Gerber files are the standard for PCB manufacturing, but they’re useless for sharing visual representations of your board. They require specialized software to view and don’t display in web browsers or standard image viewers. Converting Gerber to PNG or JPG images solves this problem by creating universally viewable files.

Use CaseWhy Image Conversion Helps
Client presentationsShare board previews without CAM software
DocumentationInclude in datasheets and user manuals
Website/portfolioShowcase projects on blogs and GitHub
Social mediaShare designs on Twitter, LinkedIn, forums
Design reviewsEmail images for quick feedback
DIY PCB fabricationCreate masks for toner transfer method
CNC millingGenerate images for fab module workflows
Quality verificationCompare manufactured boards to design

PNG vs JPG: Which Format to Choose?

FactorPNGJPG
CompressionLosslessLossy
TransparencySupportedNot supported
File sizeLargerSmaller
Best forTechnical accuracy, layersWeb sharing, thumbnails
Color depthUp to 48-bit24-bit
Sharp edgesPreservedMay blur

For PCB images, PNG is generally the better choice because it preserves sharp edges on traces and pads without compression artifacts. JPG works well for web thumbnails or when file size is a concern, but avoid it for images used in manufacturing workflows.

Understanding Resolution and DPI for Gerber Images

When converting Gerber to PNG or JPG, resolution matters significantly. The wrong DPI setting can produce blurry images or files too large to handle.

PurposeRecommended DPINotes
Web display72-150 DPIFast loading, adequate detail
Documentation150-300 DPIGood balance of size and quality
Printing300-600 DPISharp output on paper
Toner transfer600-1200 DPIPrecise masks for DIY PCBs
Archival300+ DPIFuture-proof high quality

Calculating Image Dimensions

To determine the pixel dimensions of your output image:

Pixels = Board dimension (inches) × DPI

For a 4″ × 3″ board at 300 DPI:

  • Width: 4 × 300 = 1200 pixels
  • Height: 3 × 300 = 900 pixels

Higher DPI means larger files and longer processing times, so choose appropriately for your use case.

Methods to Convert Gerber to PNG/JPG

Several approaches exist for converting Gerber files to image formats, from free command-line tools to commercial applications with full GUI interfaces.

Method 1: Using Gerbv (Free/Open Source)

Gerbv is the most popular free tool for Gerber viewing and image export. It runs on Windows, Linux, and macOS and offers both GUI and command-line operation.

GUI Conversion Process:

  1. Download and install gerbv from gerbv.github.io
  2. Launch gerbv and open your Gerber file via File → Open Layer(s)
  3. Load additional layers (copper, mask, silk, drill) as needed
  4. Adjust colors for each layer by right-clicking the layer name
  5. Set the view zoom to your desired output resolution
  6. Go to File → Export → PNG
  7. Configure DPI and save

Command-Line Conversion for PNG:

Gerbv’s command-line interface is powerful for automation and batch processing:

bash

# Basic single file to PNGgerbv -x png -D 300 -o output.png input.gbr# With custom foreground and background colorsgerbv -x png -D 300 -f “#B87333” -b “#FFFFFF” -o copper.png top_copper.gbr# Multiple layers with different colorsgerbv -x png -D 300 -f “#B87333” -f “#00FF00” -o board.png copper.gbr silk.gbr# With antialiasing for smoother edgesgerbv -x png -D 300 -a -o smooth_output.png input.gbr# Setting specific window size in pixelsgerbv -x png -w 1920×1080 -o output.png input.gbr

Gerbv Command-Line Options:

OptionDescription
-x pngSet export format to PNG
-D DPIResolution in dots per inch
-o filenameOutput filename
-f #RRGGBBForeground color (use multiple for layers)
-b #RRGGBBBackground color
-aEnable antialiasing
-B percentBorder around image (default 5%)
-w WxHWindow size in pixels
-W WxHWindow size in inches

Method 2: Using GerbView (Commercial with Trial)

GerbView by Software Companions provides professional-grade Gerber to image conversion with extensive control over output settings.

Step-by-Step Process:

  1. Download GerbView from gerbview.com (30-day trial available)
  2. Launch and go to File → Add Layer
  3. Select your Gerber files to load
  4. Import Excellon drill files if needed
  5. Adjust layer colors and visibility
  6. Go to File → Export → Raster
  7. Select PNG, JPEG, TIFF, or BMP format
  8. Configure resolution and color depth
  9. Save the image

GerbView Raster Export Settings:

SettingOptionsRecommendation
FormatPNG, JPEG, TIFF, BMP, WebPPNG for quality, JPEG for size
ResolutionCustom DPI300 for documentation
Color depth1-bit to 24-bit24-bit for color layers
CompressionVariousPNG compression level 6
BackgroundTransparent/ColorTransparent for overlay work

Method 3: Using Online Gerber Viewers

Several online tools let you view Gerber files and capture images without installing software.

Popular Online Viewers:

ServiceURLFeatures
Tracespacetracespace.io/viewSVG rendering, local processing
GerbLookgerblook.orgQuick visualization, layer toggle
PCBWay Viewerpcbway.com/project/OnlineGerberViewer.html2D/3D view
JLCPCB Viewerjlcpcb.com/RGEManufacturing-focused
HQDFM/NextPCBnextpcb.com/free-online-gerber-viewerDFM analysis included

Using Online Viewers for Image Capture:

  1. Upload your Gerber files to the viewer
  2. Adjust layer visibility and colors
  3. Set the view to your desired zoom level
  4. Use browser screenshot (or right-click → Save image if available)
  5. Crop and save using any image editor

Note: Online viewers process files locally in your browser, so your design data typically isn’t uploaded to servers. However, for confidential designs, desktop software is safer.

Method 4: Using GerberRender Script

GerberRender is a command-line script that creates realistic PCB renders from Gerber files.

Installation:

bash

# Install dependencies (Ubuntu/Debian)sudo apt install gerbv imagemagick# Clone the repositorygit clone https://github.com/brandtks/GerberRender.git

Usage:

bash

# Generate front and back rendersgerbrend# Specify output resolutiongerbrend -d 600# Generate only front sidegerbrend –front-only

This tool produces realistic-looking board renders with proper solder mask colors and metallic pad finishes.

Method 5: Using Python with gerber2png

For integration into automated workflows, Python scripts can convert Gerber files to PNG.

Basic Python Approach:

python

import subprocessdef gerber_to_png(gerber_file, output_file, dpi=300):    cmd = [        ‘gerbv’,        ‘-x’, ‘png’,        ‘-D’, str(dpi),        ‘-o’, output_file,        gerber_file    ]    subprocess.run(cmd)# Usagegerber_to_png(‘top_copper.gbr’, ‘copper_layer.png’, 600)

Method 6: Using reaConverter (Batch Processing)

For converting large numbers of Gerber files, reaConverter offers efficient batch processing.

reaConverter FeatureDescription
Batch conversionProcess hundreds of files at once
Format supportGBR, GBS, CMP, SOL variants
Output optionsPNG, JPEG, TIFF, BMP
Command lineAutomation via CLI
Image editingResize, crop, watermark during conversion

Method 7: Using scConverter SDK (Developer Integration)

For software developers, the scConverter SDK provides programmatic Gerber to image conversion.

csharp

// C# examplescconverter.AddGerberLayer(“copper.gbr”, 0xFF00B87333, 0x01);scconverter.ConvertGerberLayersToImage(    “output.png”, “PNG”, 1.0, 24, 300, 0, ref width, ref height);

This approach is ideal for building custom applications or web services that need Gerber conversion capabilities.

Creating Multi-Layer Composite Images

Real PCBs have multiple layers that often need to be combined into a single image for visualization.

Layer Stacking Order

For a typical 2-layer board, stack layers in this order (bottom to top):

OrderLayerTypical Color
1Board outlineBlack or dark gray
2Bottom copperLight blue
3Bottom solder maskGreen (transparent)
4Top copperRed or copper
5Top solder maskGreen (transparent)
6Top silkscreenWhite
7Drill holesBlack

Combining Layers with Gerbv

bash

# Load all layers with appropriate colors and transparencygerbv -x png -D 300 -a \  -f “#000000” \  -f “#0000FF88” \  -f “#00800040” \  -f “#FF000088” \  -f “#00800040” \  -f “#FFFFFF” \  -f “#000000” \  -o composite.png \  outline.gbr bottom_copper.gbr bottom_mask.gbr \  top_copper.gbr top_mask.gbr silkscreen.gbr drill.drl

The alpha channel (last two hex digits) controls transparency, allowing layers to show through each other.

Best Practices for Gerber to Image Conversion

Color Recommendations

Layer TypeSuggested ColorHex Code
Top copperCopper/red#B87333 or #FF0000
Bottom copperBlue#0000FF
Top solder maskGreen (transparent)#00800080
Bottom solder maskGreen (transparent)#00800080
Top silkscreenWhite#FFFFFF
Bottom silkscreenYellow#FFFF00
Drill holesBlack#000000
Board outlineDark gray#333333
BackgroundWhite or black#FFFFFF or #000000

Tips for High-Quality Output

  1. Use antialiasing for smoother edges on traces and pads
  2. Match aspect ratio to actual board dimensions
  3. Add appropriate border (5-10%) for visual breathing room
  4. Use PNG format for technical accuracy
  5. Verify scale by measuring known features
  6. Invert negative layers (power planes) before export

Troubleshooting Common Issues

Problem: Image Appears Blank or Mostly Empty

Causes and Solutions:

CauseSolution
Wrong coordinate offsetUse -O flag to set origin
Very small featuresIncrease DPI significantly
Inverted polarityCheck layer polarity settings
Missing aperture dataEnsure RS-274X format

Problem: Blurry or Pixelated Output

Causes and Solutions:

CauseSolution
Low DPIIncrease resolution (300+ DPI)
JPG compressionUse PNG format instead
Small window sizeSet larger pixel dimensions
Missing antialiasingEnable -a flag in gerbv

Problem: Wrong Colors or All Same Color

Solutions:

  • Specify colors explicitly with -f flag for each layer
  • Load layers in correct order
  • Check alpha channel for transparency
  • Verify layer visibility settings

Problem: File Size Too Large

Solutions:

  • Reduce DPI for web use (150 DPI)
  • Use JPG for thumbnails
  • Crop to board area only
  • Use PNG compression optimization

Resources and Download Links

Free/Open Source Software

ToolWebsitePlatform
Gerbvgerbv.github.ioWindows, Linux, macOS
GerberRendergithub.com/brandtks/GerberRenderLinux
FlatCAMflatcam.orgWindows, Linux, macOS
KiCad GerbViewkicad.orgWindows, Linux, macOS

Commercial Software

ToolWebsiteTrial Available
GerbViewgerbview.comYes (30 days)
ViewMatepentalogix.comDemo available
CAM350downstreamtech.comContact vendor
reaConverterreaconverter.comLimited free

Online Viewers

ToolURLNotes
Tracespacetracespace.io/viewLocal processing
GerbLookgerblook.orgQuick and simple
PCBWay Viewerpcbway.comManufacturing preview
JLCPCB Viewerjlcpcb.com/RGEOrder integration
HQDFMnextpcb.com/free-online-gerber-viewerDFM analysis

Frequently Asked Questions

What DPI should I use when converting Gerber to PNG?

For web display, 150 DPI is usually sufficient. For documentation or printing, use 300 DPI. For DIY PCB fabrication using toner transfer, 600-1200 DPI provides the precision needed for accurate masks. Higher DPI creates larger files and takes longer to process, so choose based on your actual needs.

Can I convert multiple Gerber layers into a single image?

Yes, most tools support loading multiple layers and exporting them as a composite image. In gerbv, load all layers, set appropriate colors and transparency for each, then export. The layers will be rendered together in the output image. Use alpha channel values in hex colors (e.g., #FF000088) to control layer transparency.

Why does my exported image look different from the Gerber viewer?

Common causes include: different background colors, missing layers, inverted polarity on negative layers, or transparency settings. Ensure all layers are loaded, check that negative layers (like power planes) are properly inverted, and verify the background color matches your expectations. Also confirm your export resolution is high enough to show fine details.

Which format is better for toner transfer PCB fabrication?

PNG is strongly recommended for toner transfer because it uses lossless compression that preserves sharp edges on traces and pads. JPG’s lossy compression can introduce artifacts that affect the precision of your mask. Use at least 600 DPI, preferably 1200 DPI, and export in black and white for maximum contrast.

How do I automate Gerber to PNG conversion for multiple files?

Use gerbv’s command-line interface in a shell script or batch file. For example, a bash loop can process all Gerber files in a directory:

bash

for file in *.gbr; do    gerbv -x png -D 300 -o “${file%.gbr}.png” “$file”done

For more complex workflows, Python scripts using subprocess calls to gerbv provide additional flexibility for file naming, color management, and error handling.

Conclusion

Converting Gerber to PNG or JPG images is straightforward once you understand the tools and options available. For most users, gerbv provides everything needed, from quick GUI exports to powerful command-line automation. Commercial tools like GerbView offer additional features for professional workflows, while online viewers work well for quick checks without software installation.

The key to successful conversion is choosing the right resolution for your purpose and using PNG format when accuracy matters. Whether you’re creating documentation, sharing designs online, or preparing files for DIY fabrication, the methods in this guide will help you produce high-quality images from your Gerber files every time.

Remember that image exports are for visualization only, not manufacturing. Always send original Gerber files to your PCB fabricator, and use images for documentation, review, and sharing purposes.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.

  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.

Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.