Gerbv (open-source Gerber viewer) has the neat ability to export a customizable rendition of a given layer-stackup, to an output PNG.
Here is the manual (Ctrl+F for "export"): http://manpages.ubuntu.com/manpages/trusty/man1/gerbv.1.html
But no matter what I try, I'm unable to come up with any way to do that export such that only the area within the board outline, is exported to the PNG.
Currently the exported PNG will show a full rectangular area (along with a set border area outside the board outline) even if the board outline is, say, a circular one.
So, is there any suggested workaround to achieve the image of just the exact board shape itself?
Or, alternatively, is there a way to assign a specific different color ONLY to the "external background" area (i.e., the excess area around the actual board outline itself) such that it is different from all colors of the area inside the board outline?
For clarification, assume I'm starting with all standard Gerber layers including an outline layer.
Here are a few things I have tried so far:
1) Standard export:
GUI approach: Load all layers. File > Export >
gerbv --dpi=600 --border=0 --export=png --output=fullBoard.png --project= myProject.gvp
2) Set window size for the export:
--window = <300,300>
This is only altering the rectangular window size (obviously it has no dependence on the actual outline layer of the board).
3) Image processing using GIMP (subtracting a representative color from the board background, i.e., the area outside the outline, and then performing a crop). Still trying, but so far, I am unable to come up with any universally working criteria for programmatically identifying JUST the area outside the board outline (represented by GKO).