code: private void saveImage( final Component comp, DiagramType type, AbstractRoboconfTransformer transformer, StringBuilder sb )
  	throws IOException {
  
  		String baseName = comp.getName() + "_" + type; //$NON-NLS-1$
  		String relativePath = "png/" + baseName + ".png"; //$NON-NLS-1$ //$NON-NLS-2$
  		if( this.options.containsKey( DocConstants.OPTION_GEN_IMAGES_ONCE ))
  			relativePath = "../" + relativePath;
  
  		File pngFile = new File( this.outputDirectory, relativePath ).getCanonicalFile();
  		if( ! pngFile.exists()) {
  
  			Utils.createDirectory( pngFile.getParentFile());
  			GraphUtils.writeGraph(
  					pngFile,
  					comp,
  					transformer.getConfiguredLayout(),
  					transformer.getGraph(),
  					transformer.getEdgeShapeTransformer(),
  					this.options );
  		}
  
  		sb.append( renderImage( comp.getName(), type, relativePath ));
  	}
docs: Generates and saves an image.
  @param comp the component to highlight in the image
  @param type the kind of relation to show in the diagram
  @param transformer a transformer for the graph generation
  @param sb the string builder to append the link to the generated image
  @throws IOException if something went wrong