Basically, yes. But KLayout is a tool made for GDS2 files and not for Gerber. The way to go, is to import into KLayout (using GDS2 layers) and then create a PNG from that.
So that takes some scripting. Here is a sketch:
Unpack the .zip archive
Create a PCB project - this is a XML file listing the artwork files and which layer (GDS notation) they will be mapped on. Store that in a file - e.g "project.pcb"
Provide display styles for these layers in Form of a .lyp file: this can be generated interactively in KLayout and saved as .lyp
Import the Gerber project file into a layout view in KLayout together with the .lyp, and using a specific configuration to disable grid lines, setting background color and such
Export the view's image as PNG
A minimum example of a PCB project is this:
<?xml version="1.0" encoding="utf-8"?>
<pcb-project>
<free-layer-mapping>true</free-layer-mapping>
<layout-layers> <!-- a list of GDS layers to map to (first one is index 0, second index 1 etc.) -->
<layout-layer>1/0</layout-layer>
</layout-layers>
<free-files>
<free-file>
<filename>2-13-1_Two_square_boxes.gbr</filename>
<layout-layers>
<index>0</index> <!-- lists the layers the file will be mapped on, 0 = first layer (see above) -->
</layout-layers>
</free-file>
</free-files>
<merge-flag>false</merge-flag>
<dbu>0.001</dbu>
<cell-name>PCB</cell-name>
</pcb-project>
Comments
Hi @hieund,
Basically, yes. But KLayout is a tool made for GDS2 files and not for Gerber. The way to go, is to import into KLayout (using GDS2 layers) and then create a PNG from that.
So that takes some scripting. Here is a sketch:
A minimum example of a PCB project is this:
Matthias
Thanks a lot @Matthias