Site Tools


controlling_the_style_of_vorosketch_voronoi_diagrams

Controlling the style of Vorosketch Voronoi diagrams

Command line options

Vorosketch offers several options to control the drawing style of Voronoi diagrams:

            Image size options
-r n resolution: set output resolution to n × n pixels (default: 2000). Note: the size of site markers and the line widths in pixels are fixed, so increasing or decreasing the resolution is the only way to make them relatively thinner or thicker.
-w x width: clip diagram to [−x,x] × [−x,x] (default: [−1,1] × [−1,1])
            Colour options
 -p zzz palette: draw sites and regions using the colour palette named zzz, where zzz is of the form filename:palettename (see below under "palettes file format") or zzz is one of the built-in palettes:
Trubetskoy-Original 20 simple, distinct colours from Sasha Trubetskoy.
Trubetskoy-Default Trubetskoy-Original, without the dark blue
Trubetskoy-Modified Trubetskoy-Original, with the dark red and blue replaced by brighter variants
Grey 6 gradations of grey
Stone 20 stonish colours
BrightStone 19 brighter variants of the above
Flat 12 very different colours
Bright 12 very bright, very different colours
The default palette has no name and “colours” all regions white.
-c coloured: this is a shorthand for -p Trubetskoy-Default
-h high contrast: try to give adjacent regions contrasting colours instead of assigning colours in according to input order. Warning: This option is implemented with an experimental heuristic that is very slow if there are many sites, and I am looking to replace it with something more efficient.
-l low contrast: try to give adjacent regions similar colours instead of assigning colours in according to input order. Warning: This option is implemented with an experimental heuristic that is very slow if there are many sites, and I am looking to replace it with something more efficient.
-x adjust the saturation of a region's colour based on the number of neighbouring regions: regions with many neighbours get intense colours; regions with few neighbours get pale colours. Warning: no effect if all regions are white. This option is experimental and is likely to be fine-tuned in future version to better adapt to the distribution of numbers of neighbours.
-k x colour each point based on the distance to the closest site, instead of giving each region its own colour. Colours are selected by interpolating between a range of colours specified by the palette. The default palette uses gradations from black (far away) via blue, magenta (at distance x), red, and yellow to white (at distance zero). All built-in palettes currently use the same black-to-white scheme—this might change in the future.
-t x colour points at distance more than x from the closest site as if not belonging to any region, that is, at unbounded distance to any site.
-* mark all sites with the same symbol in the same colour (as opposed to drawing each site in the same colour as its region). Note that you may need to write -\* or “-*” so that the shell does not try to interpret the *.
            Shading options
-g x darken each pixel based on the distance to the closes site, with maximum brightness at distance 0, half the rightness at distance x, and pure black at distance ∞.
-z apply shading based on the angle between the distance gradient and sun light from the upper left. Using this together with -g results in a warning that these options are mutually exclusive. They are not really, but you should be careful when doing so, because combining the two options moves the brightest spot in a region away from the site.
-o omit shading of pixels within distance zero (for additively/subtractively weighted or unweighted diagrams) or within distance one (for multiplicatively/divisively weighted diagrams) from their site. The default behaviour is to render such pixels shaded. If the -g, -i, -k, -t and -z options are not used, then he -o option can save some time because it may enable Vorosketch to mark whole blocks as belonging to a particular site's region without computing distances for each pixel.
            Linework options
-a anonymous: do not draw the sites
-b boundaries: draw region boundaries (the default behaviour is to do so only if all regions are coloured the same and the -z option is not used)
-i x interval: draw distance contour lines at intervals of x distance units
-5 5ths: emphasize every fifth contour line
-u unit contours: draw distance contour lines at distance 0 (for additively/subtractively weighted or unweighted diagrams) or 1 (for divisively weighted diagrams) from each site—even in the regions of other sites
-+ crosshairs: mark the origin of the coordinate system (the centre of the image)

Palettes file format

A file with colour palettes consists of a list of keywords, each followed by a value. The keywords and values are separated by spaces or line breaks. The values are of three types:

  • A name is a string without spaces.
  • A colour is a sequence of three values, separated by spaces, each in the range [0,255], denoting, in order, the red, the green, and the blue component of the colour.
  • A list is a sequence of a number, followed by that number of colours.

The following keywords are recognised:

keyword value use default
palette name marks the start of the palette with the given name, by which it is identified in the argument to the -p option
sites list used to colour regions if the -k option is not used 1 255 255 255 (all white)
gradient list used to colour regions if the -k x option is used; points very far from their site get the first colour of the list; points at distance x get the median colour of the list; points at distance 0 get the last colour of the list see above under -k
unclaimed colour colour of points that have undefined or unbounded distance to all sites 0 0 0 (black)
bisector colour colour of region boundaries 0 0 0 (black)
softedge colour shading of region boundaries if the -z option is used without the -b option 249 249 249
minorcontour colour shading of distance contours from the -i option 224 224 224
majorcontour colour colour of distance contours from the -5 and -u options 0 0 0 (black)
highway colour colour of highways if the Euclidean or Manhattan highway distance is used 192 192 192 (grey)
highwayoutline colour colour of highway outlines if the Euclidean or Manhattan highway distance is used 0 0 0 (black)
site colour colour of site markers if all are coloured the same, that is, whenever the region colour list contains only one colour or when the -k or the -* option is used 0 0 0 (black)
siteoutline colour colour of the outline and the arrow of site markers if sites are coloured in multiple colours or if sites have a direction or orientation 0 0 0 (black)
origin colour colour of the origin marker 0 0 0 (black)
originoutline colour colour of the outline of the origin marker 255 255 255 (white)
controlling_the_style_of_vorosketch_voronoi_diagrams.txt · Last modified: 2023/03/21 09:38 by administrator