sch-rnd-aux knowledge pool
The fill-gray-threshold export option
fill_gray_thrs by Tibor 'Igor2' Palinkas on 2022-08-11 | Tags: insight, export, monochrome, color, black, white, gray, grey, title, box, block, background, fill, polygon, box, rectangle |
Abstract: There are different colors on the screen for a drawing, which would translate fine to grey-scale in non-color export. In monochrome export we want to use black and white only, to have high contrast. Plus different slightly shades of grey wouldn't help as much in telling wires apart from symbol graphics as blue vs. green on screen. However, converting everything to black fails when it comes to the light background fill of the titlebox.
The problem is that the code doesn't know why it fills a polygon, whether it'd be a light background fill or whether it will be a solid fill (like in the little arrow of a BJT). So there can't be a solution that works differently for titlebox in rendering.
There are the following possible cases with any exporter:
- 1. Color output; should look the same as on screen (for the ps exporter this is --ps-color, for eps and png this is the default, when --monochrome is not set).
- 2. Monochrome with full gray-scale; that means screen colors will make various different gray shades, for wires, for symbol decoration, etc, which is not good for contrast.
- 3. Monochrome export is strictly black and white, which is good for the contrast but makes titlebox background black.
- 4. In monochrome implement a threshold: depending on how light the fill color is, use black or gray-scale. This assumes light fills are used more for the titlebox-kind of background fills and darker fills are more for the solid fills.
sch-rnd implements 1 and 4 in ps, eps and png exports. There's a new setting called fill-gray-threshold which is in percentage between 0 (dark black) and 100 (bright white). It affects only polygon fills. If a fill color is brighter than the set percentage, the code will do a proportional gray fill, else it keeps black (for the contrast). Default value is 80%.
It is not done in color export, so 1 is kept intact.