Laboratory for Epitaxial Nanostructures on Silicon and Spintronics

Affiliated Institutions

Nanoscale Device Group

Graphene software - SVGMarks


Devices based on graphene and related 2D materials (‘graphene’ for short) are usually fabricated by patterning graphene deposited on a Si substrate by mechanical exfoliation. Such deposited graphene flakes are randomly distributed on a chip. The probability of obtaining monolayer graphene in this process is very small (a few monolayers per mm2). For this reason, patterning graphene (or any other sparse and randomly distributed set of objects) requires deposition of graphene on a prepatterned substrate containing a coordinate system (usually defined by a matrix of marks). The coordinate system is used to precisely locate graphene on a chip allowing design of lithographic patterns. The software presented here (SVGMarks) is used to process images of graphene flakes and marks such that they can be imported into a design file.

Image processing is necessary for two reasons. Firstly, the coordinate system of the image usually does not coincide with the coordinate system of the design file (even if the images are taken with great care a slight rotation is always present). Secondly, the exact image dimensions and coordinates of the image center are required to scale and place an image in the correct position in the design file.


SVGMarks is free to use (giving back for the free digitizers the author used prior to developing SVGMarks). The latest releases are:

3.0826 Sep 2020Fixed error ‘Parameter is not valid’. The problem was caused by the latest release of Inkscape 1.0.x which depreciated some of the commands without providing backward compatibility. This version of SVGMarks is not required for Inkscape 0.92.x. Please see Installation for more details.
The future release SVGMarks 4.0 will permanently eliminate such problems by getting rid of Inkscape.
3.0722 Jan 2018It is possible to change the size, thickness, and color of the marks.
Fixed problem with some high-resolution images (e.g., taken by a smartphone).
3.0615 Sep 2017It is possible to type minus sign in the text boxes using the numerical keypad.
Fixed problem with a wrong directory separator in Linux.
3.0512 Sep 2017Fixed error ‘Input string was not in a correct format’. The problem was caused by a recent version of Inkscape which changed the format of some vector objects.

You can also download example used in this manual. The zip file contains the "purple" image of graphene flakes (g02_1314_1525.jpg) and design file with alignment marks (Graphene_Marks.gds) which can be seen in the following images in this manual. Note: the design file is not suitable for automatic alignment as the numbers are too close to the marks (but could be fine if you have a laser interferometer stage).


  1. .NET Framework (free).
    Newer Windows PCs (Win 7 and above) already have .NET Framework installed. To find out do you need it just run SVGMarks. If you do not get any error on startup you are fine.
  2. Inkscape (free).
    SVGMarks uses Inkscape for manual alignment.


  1. Unzip SVGMarks.zip in the folder of your choice. The zip file contains three files: SVGMarks.exe (executable), SVGMarks.ini (configuration file; SVGMarks does not mess with the Windows registry), and TextBoxEN.dll (utility to enter numbers in text boxes).
  2. Run SVGMarks and click on Settings. The text box ‘Inkscape executable (incl. path)’ contains the full file name (including path) of the Inkscape executable which you should have already installed. The current value %PROGRAMFILES%\Inkscape\bin\inkscape.exe corresponds to an executable in a default Inkscape 1.0.x installation. Click on ‘Test’ to check whether SVGMarks can find the Inkscape executable in the specified location. If the test fails, the path to your Inkscape executable is different. In this case, click on ‘Browse’ and browse to inkscape.exe on your PC.
  3. Note: due to a backward incompatibility between Inkscape 1.0.x and 0.92.x, SVGMarks needs to know which version is installed (the default is 1.0.x). The automatic version detection is performed by clicking on ‘Test’, which is the reason the test takes a bit longer now because SVGMarks invokes Inkscape to get the exact version (if the executable exists).
  4. Optional: if you like SVGMarks make a shortcut to SVGMarks.exe on the desktop.


  1. Run SVGMarks.exe. The window shown in Fig. 1 appears.

    Fig. 1. SVGMarks window. The text box in the upper left corner (‘Input image’) contains the file name of the image to be processed. Initially, the program offers image.jpg stored in your personal folder (as an example - this image probably does not exist on your PC). Other text boxes contain names of the files which will be created by SVGMarks during processing (their names are derived from the file name of the input image).

  2. Click ‘Open’ and browse for the image to be processed. Selected image will be shown in the Preview pane on the right (Fig. 2). If you prefer you can type the full file name in the text box instead of browsing for the image. If you decide to type, press Enter when you finish to tell the program that your input is over and that you want to open the image.

    Fig. 2. Preview of the image to be processed. The image shows graphene flakes of different thicknesses (from a monolayer to a thick multilayer). Three Au marks (which define the local coordinate system of the image) can also be seen. In this image the sample is deliberately rotated in order to demonstrate the capabilities of SVGMarks. In reality, the axes of the local coordinate system should be as parallel to the image edges as possible (i.e., the line connecting the two bottommost marks should be as parallel to the horizontal edge of the image as possible).

  3. Click ‘Align’ and wait until Inkscape shows up (Fig. 3).

    Fig. 3. The input image loaded in Inkscape with four black marks (in the corners), which should be placed on top of the existing (patterned) marks visible in the image (see below).

  4. Place the black marks over the corresponding marks in the image, e.g., the black mark in the bottom left corner should be placed on top of the patterned mark whose original location is the bottom left corner (Fig. 4). The best results are obtained if you use three marks (in which case SVGMarks applies both rotation and shear transformations on your image; the fourth black mark will be ignored). If only two patterned marks are visible, use only two corresponding black marks (in which case SVGMarks will only rotate your image). SVGMarks currently does not support image transformation with all four marks (i.e., one mark is always ignored).

    Fig. 4. Placing black Inkscape marks over the marks in the image: (Top) Roughly place the marks and click on one of the marks (to select it). (Bottom) Click on button ‘Zoom to fit selection in window’ located in the Inkscape toolbar (or simply press key 3) and make a fine adjustment of the mark position. When finished click on button ‘Zoom to fit drawing in window’ (to go to the previous view; or press key 4). Repeat the procedure for the other marks.

  5. Close Inkscape (save document).
  6. Use the check boxes (Fig. 5) to select which marks were used in Inkscape. In the previous example, three marks were used (in the bottom left, bottom right, and top left corner) and their check boxes should be checked to tell SVGMarks which marks should be used for image transformation. Type the coordinates of the marks in the corresponding text boxes ‘Xmin’, ‘Xmax’, ‘Ymin’, and ‘Ymax’ next to the check boxes (Fig. 5). Values and units should correspond to the design file. In this case the coordinates are x = 400 µm, y = -400 µm (mark in the bottom left corner), x = 480 µm (mark in the bottom right corner), and y = -320 µm (mark in the top left corner).

    Fig. 5. Selection of marks and their coordinates in the design file (where the processed image will be placed).

  7. Click Transform.

    After processing is done the transformed image appears in the preview pane (Fig. 6). This image is stored both in PNG and BMP format (file names are in the text boxes ‘Output - Transformed PNG’ and ‘Output - Transformed BMP’). The coordinates of the image center and image dimensions are shown in the text boxes below the image. These data are used to correctly place the image in the design file.

    Fig. 6. The transformed image can be imported into the design file as the axes of its local coordinate system are parallel to the axes of the coordinate system of the design file (after transformation, translational symmetry is established between the systems). The numerical values which define the position of the transformed image in the design file can be seen below the image. Angle (in degrees) is not used in the design file (it just shows how much the original image was rotated)

    The rest of this manual explains how to place the transformed image in the design file (keep SVGMarks open). In this case the Raith Elphy software suite is used.

  8. Open the design file in Elphy (Fig. 7).

    Fig. 7. Design file opened in Elphy (left window) and transformed image (right window).

  9. Open the transformed image: File → Open image... → Browse for the transformed image whose full file name is given in the SVGMarks text box ‘Output - Elphy SSC’. Hint: it is much faster to copy-paste the file name instead of browsing. Do the following: Click in the text box ‘Output - Elphy SSC’ → Ctrl+A (to select all; works in English Windows) → Ctrl+C (to copy the full file name) → Paste in ‘File name’ of Elphy with Ctrl+V. The image shows up (Fig. 7).
  10. Click on the design file window to put it in the foreground. Click Options → Show video. The rotated image shows up in the design file (Fig. 8).

    Fig. 8. Transformed image placed in the correct position in the design file. (Top) Overview. (Bottom) Magnified parts of the design file around marks demonstrate fine alignment.

  11. Design your pattern...

Linux version

The same Windows executable works in Linux. The differences with respect to the Windows version are listed below. They are given for Ubuntu 17.04.

  1. Linux version requires Mono (free) which is an open source implementation of .NET Framework.
    You can install Mono from the Ubuntu Software Center (Fig. 9).
  2. Fig. 9. MonoDevelop can be installed from the Ubuntu Software Center.

  3. Linux version requires Inkscape for Linux (free).
    You can install Inkscape from the Ubuntu Software Center (Fig. 10).
  4. Fig. 10. Inkscape can be installed from the Ubuntu Software Center.

  5. The default link to Inkscape in the text box ‘Inkscape executable (incl. path)’ is obviously wrong. Most likely, the correct link is /snap/bin/inkscape which you can directly type in the text box ‘Inkscape executable (incl. path)’. Otherwise, you can browse for Inkscape using button ‘Browse’. If you do not know where to look for, the correct path can be found by executing command ‘which inkscape‘ in the terminal.
  6. Fig. 11 shows SVGMarks and Inkscape running in Linux.

    Fig. 11. Image transformation in Linux. (Top) SVGMarks in Linux. (Bottom) Inkscape in Linux.

Copyright © 2010 L-NESS Como