1 Introduction

Printing on paper remains an important medium for communication despite the recent development of electronic devices; for example, smartphones and tablets, and even now, printing in black and white (B/W) are widely used. To include color figures and graphs in B/W printing, they should be converted to black and white.

A standard method for B/W conversion is color-to-grayscale conversion via a lightness channel. However, with this standard method, chromatic information is entirely ignored, and thus, information in the original figures/graphs is often lost.

Two approaches have already been proposed to solve this information-loss problem: contrast-enhancing color to grayscale conversion [1,2,3,4,5,6,7,8,9,10,11,12,13,14] and color-to-texture conversion [15,16,17,18,19,20]. Moreover, to keep the information converted by both approaches, the printing media should be of high quality so that the grayscale levels or fine textures are properly reproduced.

To make the B/W conversion more robust and usable even for low-quality printing, this study focuses on hatching, a technique of drawing parallel lines in close proximity to represent shading effects.

In this paper, we propose a conversion method from color in scalable vector graphics (SVG) figures to new extended hatching, representing color differences very well. While conventional hatching with parallel straight lines is inadequate for a variety of colors, our extended hatching with, e.g., lightning-like zigzag lines, can represent the differences in the original color even if the original tone is mostly lost.

This paper is organized as follows: Sect. 2 overviews the background of the study with related research. Section 3 provides an overview of the proposed approach. Section 4 elaborates on our approach and introduces some variations in our approach. The experiments are presented in Sect. 5, and Sect. 6 discusses the printing cost savings compared with existing methods, the limitations of our method, its applications, and its relation to visualization. Finally, Sect. 7 concludes the paper with some comments on future work.

2 Background and related work

To display color images on monochrome devices, the images are conventionally converted to grayscale images by lightness. For example, in ITU-R Recommendation BT.601, YUV (typical YUV), luma (gamma-corrected luminance) Y’ is given by:

$$ Y^{^{\prime}} = 0.299R^{^{\prime}} + 0.587G^{^{\prime}} + 0.114B^{^{\prime}} $$

where R′, G′, and B′ are the red, green, and blue signals.

However, with this standard method, chromatic information is entirely ignored, and thus, colors of similar lightness are indistinguishable even if their hues are distinguishable.

To preserve or enhance contrasts between colors of similar lightness, many authors have proposed decolorization methods. Bala and Braun [1] assigned distinct gray values to colors in business graphics. Gooch et al. [2] optimized the modulation of source lightness differences to reflect the gap in chrominance. Rasche et al. [3] extended the decolorization problem to reduce the gamut dimensions for color-deficient viewers. Grundenland and Dedgson [4] improved decolorization efficiency. Smith et al. [5] and Kuhn et al. [6] proposed other fast conversion methods. According to Gestalt principles, Wu et al. [7] decomposed the input image into soft segments, and Ji et al. [8] considered the boundary instead of segmentation. Cui et al. [9] used ISOMAP, a nonlinear dimensionality reduction method, and Zhu et al. [10] applied Broadbent’s filter model of attention to the color-to-gray conversion. Recently, efficiency and contrast preserving properties have been improved (e.g., [11,12,13,14]).

Another approach for color-to-monochrome conversion is texturing. Roetling encoded eight basic colors as textures from unique RGB texture patterns for B/W dot printing [15]. Harrington mapped colors to visible B/W textures, where similar colors were mapped to similar textures [16, 17], and Bai et al. [18] improved the texture patterns. Queiroz and Braun [19] proposed a reversible method in which colors are mapped to gray textures and the color information is recovered from the texture. Guss used distinct line directions for RGB and represented colors using B/W textures [20].

In our view, neither of the above two approaches, grayscale conversion and texturing, are in practical use, particularly for low-cost B/W printing. Both these approaches rely on high-quality printing, where shading representation and pixel-by-pixel on/off should be accurate. These properties are not expected for conventional B/W printing.

There are two types of color images: pictorial images and business/presentation graphics images [17]. This study focuses on the latter, and we assume that each region in the image is uniformly colored. In color business graphics, hue plays a major role in discriminating regions, compared with lightness and saturation. Even if the image is converted to B/W, each colored area should be identifiable, as in color. The existing methods of grayscale conversion and texturing are inappropriate for this purpose.

We then focus on hatching. Hatching is an artistic technique for drawing closely spaced parallel lines. It is visually clear and superior in discriminating between regions. Existing hatching techniques in graphics community mainly reflect shapes, contours, shading, etc. (e.g., [21,22,23]). In technical drawings, the material of a part is indicated by hatching [24]. To the best of our knowledge, conversion from color to hatching has not yet been proposed.

As discussed above, hue is most critical in color business/presentation graphics and can be mapped to the direction of hatching lines (Fig. 1). If the difference between the hues of the two regions is large, discrimination is easy. For similar colors, however, the direction of the hatching lines is not sufficient for discriminating many regions.

Fig. 1
figure 1

Hue and hatching angles

In this study, we propose a conversion method from color to hatching, where even regions of similar colors are identifiable.

3 Overview

To improve the discriminability between hatching patterns from similar colors (hues), we focused on clocks (timepieces). Analog clocks display time according to the directions of their hands in 12 h. If they have only a single hand, the displayed time is ambiguous. Clocks usually have two hands: long (minute) hand and short (hour) hand, and the pair of hands enables us to identify time accurately in 12 h. This analogy can be applied to hatching.

We supposed that input images were in SVG format [25], where each region, for example a country in a world map or a slice in a pie chart, is represented as a closed path and colored uniformly. We then filled each region with a hatching pattern corresponding to its original color.

As discussed in the previous section, the hue of a region can be represented by the direction of the hatching lines (Fig. 2b). However, it is inappropriate for discriminating similar hues, such as a single-hand clock.

Fig. 2
figure 2

Comparison of our hatching patterns

By analogy to a clock, attaching short line segments to hatching lines greatly improves the discriminability between similarly colored regions (Fig. 2c). By modifying the geometry, zigzag hatching (Fig. 2d) and wave hatching (Fig. 2e) are also available for disambiguation. In the next section, we discuss how to generate the aforementioned hatching patterns.

4 Methods

The color of each region is first converted to a triplet of hue, saturation, and lightness. By default, we used CIELAB, and the hue (angle) and saturation/chroma were obtained using the cylindrical model. Other color models, such as HSV and HSL, can also be applied.

Each region (interior of the closed path) was tiled with a tilted hatching pattern. The hatching pattern and its tilt (rotation) angle were obtained from the hue of the region, as described below.

4.1 Simple hatching pattern

In this study, a hatching pattern is a rectangle whose top-left corner is the origin of the coordinate system, and the bottom-right corner is \(\left( {W_{{{\text{hatch}}}} ,H_{{{\text{hatch}}}} } \right)\). In our simple hatching pattern, a straight line was drawn vertically in the center to prevent overlapping with the border of the pattern (Fig. 3). \(W_{{{\text{hatch}}}}\) is determined by lightness if hatching reflects the lightness of the region color, as discussed in Subsection 4.6. \(H_{{{\text{hatch}}}}\) is typically equal to \(W_{{{\text{hatch}}}}\).

Fig. 3
figure 3

Geometry of a simple hatching pattern

4.2 Pattern angle

The above hatching pattern was rotated and laid over the region to represent the hue of the source color of the region. The simple hatching pattern rotated by 180° is the same as the original pattern, and then, our pattern rotation angle \(\theta_{{{\text{pattern}}}}\) is given by

$$ \theta_{{{\text{pattern}}}} = \frac{{\theta_{{{\text{Hue}}}} }}{2} $$

where \(\theta_{{{\text{Hue}}}}\) is the hue angle of the source color (\(0 \le \theta_{{{\text{Hue}}}} < 360\)). Figure 1 shows a pair of sample color pie charts and their simple hatching images.

4.3 Segment attached hatching

As discussed in Sect. 2, simple hatching is weak in discriminating between regions of similar colors in the source image. By analogy to a clock, we attach short line segments to a simple hatching pattern (Fig. 4). The pattern angle, corresponding to the direction of (parallel) lines, roughly represents the hue, and the angle between the line and the attached segment, \(\theta_{{{\text{short}}}}\), shows subtle differences between hues. In other words, \(\theta_{{{\text{pattern}}}}\) and \(\theta_{{{\text{short}}}}\) correspond to the hour and minute hands in a clock, respectively.

Fig. 4
figure 4

Geometry of a short segment hatching pattern

The short segment angle \(\theta_{{{\text{short}}}}\) is given by

$$ \theta_{{{\text{short}}}} = 180\left( {\frac{{\theta_{{{\text{pattern}}}} }}{{\theta_{{{\text{OE}}}} }} - \lfloor\frac{{\theta_{{{\text{pattern}}}} }}{{\theta_{{{\text{OE}}}} }}}\rfloor \right) $$

\(\theta_{{{\text{OE}}}}\) is a period of \(\theta_{{{\text{short}}}}\), which is determined so that the directions of the main hatching lines can be discriminated between \(\theta\) and \(\theta + \theta_{{{\text{OE}}}}\), and \(\lfloor{x}\rfloor\) is a floor of \(x\). In a clock, \(\theta_{{{\text{OE}}}}\) corresponds to 30° (angle for an hour) of the hour hand. Figure 2c shows the segment attached to the hatching of the colored region in Fig. 2a.

4.4 Zigzag hatching

Modifying the geometry in the above hatching pattern yielded some variational hatching patterns. In zigzag hatching (Fig. 2d), zigzag lines replace straight lines in simple hatching to clarify subtle differences between similar colors.

Let \(l_{{{\text{long}}}}\) and \(l_{{{\text{short}}}}\) be lengths of segments where \(l_{{{\text{short}}}} < l_{{{\text{long}}}}\), and the short segment angle \(\theta_{{{\text{short}}}}\) is the same as in the previous subsection. In our experiment, \(l_{{{\text{short}}}} = \frac{{l_{{{\text{long}}}} }}{2}\). The zigzag angle \(\theta_{{{\text{zigzag}}}}\) is then given by

$$ \theta_{{{\text{zigzag}}}} = \left\{ {\begin{array}{*{20}c} {180 - \theta_{{{\text{short}}}} } & {(0 \le \theta_{{{\text{short}}}} < 90)} \\ {\theta_{{{\text{short}}}} } & {(90 \le \theta_{{{\text{short}}}} < 180)} \\ \end{array} } \right. $$

Two segments of lengths \(l_{{{\text{long}}}}\) and \(l_{{{\text{short}}}}\) form an included angle \(\theta_{{{\text{zigzag}}}}\), as shown in Fig. 5. From the law of cosines, the height of the Zigzag hatching pattern \(H_{{{\text{zigzag}}}}\) is given by

$$ H_{{{\text{zigzag}}}} = \sqrt {l_{{{\text{long}}}}^{2} + l_{{{\text{short}}}}^{2} - 2l_{{{\text{long}}}} l_{{{\text{short}}}} \cos \theta_{{{\text{zigzag}}}} } $$
Fig. 5
figure 5

Geometry of a zigzag hatching pattern

The width of the pattern \(W_{{{\text{zigzag}}}}\) is determined by lightness if the hatching is reflected by the lightness of the region color, as discussed in Subsection 4.6.

Note that the intersection point of the two segments is placed on the left side if \(0 \le \theta_{{{\text{short}}}} < 90\) (Fig. 5a), and on the right if \(90 \le \theta_{{{\text{short}}}} < 180\) (Fig. 5b).

4.5 Wave hatching

Smoothly connecting the endpoints of the two segments in zigzag hatching yields wave hatching (Fig. 2e). Suppose that the intersection point (and also the endpoints) of the two segments in zigzag hatching is \(\left( {x_{2} ,y_{2} } \right)\), and the other endpoints of the short and long segments are \(\left( {x_{1} ,y_{1} } \right)\) and \(\left( {x_{3} ,y_{3} } \right)\), respectively (see Fig. 5). Then, we draw two cubic Bézier curves. One has four control points: \(\left( {x_{1} ,y_{1} } \right)\), \(\left( {x_{1} ,y_{2} } \right)\), \(\left( {x_{2} ,y_{1} } \right)\), and \(\left( {x_{2} ,y_{2} } \right)\), and the control points of the other are \(\left( {x_{2} ,y_{2} } \right)\), \(\left( {x_{2} ,2y_{2} } \right)\), \(\left( {x_{3} ,y_{3} - y_{2} } \right)\), and \(\left( {x_{3} ,y_{3} } \right)\) (Fig. 6).

Fig. 6
figure 6

Geometry of a wave hatching pattern

Similar to zigzag hatching, the curves are drawn on the left side if \(0 \le \theta_{{{\text{short}}}} < 90\) (Fig. 6a), and on the right if \(90 \le \theta_{{{\text{short}}}} < 180\) (Fig. 6b).

4.6 Mapping lightness to intervals between lines

The representation of hue has been discussed thus far in this section, and this subsection focuses on lightness. From our hatching mechanism, where rectangular hatching patterns are laid over regions, lightness is controlled by the interval between hatching lines, and the interval is equal to the width of the hatching pattern \(W_{{{\text{hatch}}}}\).

Any positive monotonically increasing function can be mapped from the lightness value of a region to its \(W_{{{\text{hatch}}}}\). We then use

$$ W_{{{\text{hatch}}}} = W_{\min } \left( {1 + L^{^{\prime}} } \right)^{p} $$

where \(W_{\min }\) is the minimum interval between hatching lines such that the hatching direction is identifiable, L′ is the lightness normalized to \(0 \le L^{^{\prime}} \le 1\), and \(p\) is an arbitrary parameter. Figure 7 compares a sample pie chart composed of slices of similar hue and different lightness values and its simple hatching result.

Fig. 7
figure 7

Lightness and line intervals

4.7 Mapping saturation to dashed lines

If required, the proposed method represents saturation via dashed lines. From the saturation S′, normalized to \(0 \le S^{^{\prime}} \le 1\), the lengths of the stroke and the break are

$$ l_{{{\text{stroke}}}} = S^{^{\prime}} L_{{{\text{base}}}} $$
$$ l_{{{\text{break}}}} = \left( {1 - S^{^{\prime}} } \right)L_{{{\text{base}}}} $$

where the base length \(L_{{{\text{base}}}}\) is usually used as \(W_{{{\text{hatch}}}}\). Figure 8 compares a sample pie chart composed of slices of different saturations and its simple hatching result.

Fig. 8
figure 8

Saturation and dashed lines

5 Results

We implemented a color-to-hatching conversion system. Figure 2 illustrates the hatching patterns with a source color. Figure 9 shows how our hatching clarifies the differences between regions of similar colors in the original color pie chart. Figures 11 and 12 compare our hatching and Color2Gray [2] results converted from a map of subprefectures on Hokkaido Island in Japan (Fig. 10).

Fig. 9
figure 9

Comparison of patterns for similar colors (top-left: original color image; bottom row: hatching samples)

Fig. 10
figure 10

A color image of subprefectures in Hokkaido Island (Subprefectures of Hokkaido.svg created by Lincun at Japanese Wikipedia, under CC BY-SA 3.0 license (http://creativecommons.org/licenses/bysa/3.0/))

To mimic a low-cost B/W printing process, the images in Figs. 11 and 12 were printed on a laser printer (Canon LBP7200CN), photocopied by an electrostatic copier (Xerox ApeosPort-IV 4471) and then scanned (Canon CanoScan LiDE 400) (Fig. 13). In Fig. 14, a stencil printer (Riso Kagaku Risograph RZ770) replaces the copier. The features of hatching survive, and the regions are still discriminable even in low-cost B/W printing.

Fig. 11
figure 11

A hatched image converted by our method (segment attached hatching + dashed lines)

Fig. 12
figure 12

A grayscale image converted by Color2Gray [2]

Fig. 13
figure 13

Images photocopied by an electrostatic copier (left: ours (segment attached hatching + dashed lines); right: Color2Gray [2])

Fig. 14
figure 14

Images printed by a stencil printer (left: ours (segment attached hatching + dashed lines); right: Color2Gray [2])

From these results, Color2Hatch can clarify subtle differences in the color of regions compared with the existing methods, as discussed in Sect. 2. In addition, the results of the proposed method do not appear dark; in other words, they consume much less ink/toner in printing. This reduces the printing cost, as discussed in the next section.

6 Discussions

6.1 Printing cost savings

In this section, we compare the printing costs of our method with those of existing printing methods. Both mass printing and small quantity printing with PC printers are discussed below.

6.1.1 Mass printing

A printing price list for estimation is the price of mass printing, by a printing company. The printing priceFootnote 1 is proportional to the number of color inks in both sheet-fed printing and rotary printing, and color materials are usually printed with four types of ink (C(cyan), M(magenta), Y(yellow), and K(black)) [26]. If color images are translated to our hatched representation, the printing cost is reduced by one-fourth.

6.1.2 Small quantity printing

We often use PC printers such as laser or inkjet printers for small quantity printing, and most of the printing cost of these printers is that of toners and inks.

Laser printers. A laser printer prints an image by transferring and fixing the toner (powdered ink) to a paper, and four types of toners (CMYK) are used in color laser printers. Although accurately predicting toner usage is an ongoing research problem [27], we make a simple estimation of toner usage based on its area coverage. The color shades are represented by the quantity of the toner fixed on a paper, and the relation between the area coverage of the toner and lightness is represented by a tone reproduction curve. In our estimation, from the real tone reproduction curve of a color laser printer [28], we model a simple tone reproduction curve, as shown below (Fig. 13):

$$ L^{*} = \left\{ {\begin{array}{*{20}c} {100 - c} \\ {100 - 0.5c} \\ \end{array} } \right.\begin{array}{*{20}c} {\left( {{\text{black}}} \right)} \\ {\left( {{\text{cyan}}, {\text{magenta}}, {\text{yellow}}} \right)} \\ \end{array} $$

where \(c\) is the area coverage of the toner (\(0 \le c \le 100\)), and \(L^{*}\) is the lightness (\(0 \le L^{*} \le 100\)).

To map an RGB color to the quantity of the four types of toner, we first convert RGB to CMYK. Although the current color printing devices/drivers usually use 3D LUT for RGB–CMYK conversion, our estimation uses a simple conversion method, which was used in early color printers [29]. The conversion method from \(\left( {R,G,B} \right)\) is (\(0 \le R,G,B \le 255\)):

Step 1. \(C_{1}\), \(M_{1}\), and \(Y_{1}\) are obtained as.

\(C_{1} = 255 - R\), \(M_{1} = 255 - G\), \(Y_{1} = 255 - B\).

Step 2. \(K\) is obtained as.

\(K = {\text{Min}}\left( {C_{1} ,M_{1} ,Y_{1} } \right)\).

Step 3. \(C_{2}\), \(M_{2}\), and \(Y_{2}\) are obtained as.

\(C_{2} = C_{1} - K\), \(M_{2} = M_{1} - K\), \(Y_{2} = Y_{1} - K\).

The resultant \(\left( {C_{2} ,M_{2} ,Y_{2} ,K} \right)\) is then used to obtain the toner quantities matching the toner reproduction curve.

Table 1 compares the quantity of the toner in color printing, grayscale printing, and our hatching for a few sample colors.Footnote 2 We suppose that our hatching uses segment-attached hatching, where the length of the short segments is half of \(W_{{{\text{hatch}}}}\) (and \(H_{{{\text{hatch}}}}\)), the width of the long/short segments is one-tenth that of \(W_{{{\text{hatch}}}}\), the long/short segments are in pure black, and lightness and saturation are not considered in hatching.

Table 1 Comparison of estimated toner/ink consumptions

As presented in Table 1, except for light colors (e.g., yellow), our hatching method consumes much less toner than color printing and grayscale printing, even if the price difference between black (K) toner and color (cyan, magenta and yellow (CMY)) toners is not taken into consideration.

Inkjet printers. An inkjet printer prints an image by propelling droplets of ink onto paper, and four types of ink (cyan, magenta, yellow and black (CMYK)) are used in typical color inkjet printers.Footnote 3 Similar to laser printers, the shades of colors are represented by the quantity of ink on a paper, and it is controlled by halftoning, for example, Bayer dithering or error-diffusion methods. Assuming the ink has a tone reproduction curve similar to that shown in Fig. 15, the estimation in Table 1 is valid for inkjet printers, and our hatching method has a cost advantage.

Fig. 15
figure 15

A model tone reproduction curve

Note that the above estimations of toner/ink consumption are based on simple assumptions and ignore many factors in the real world, for example the order of toners/inks, the overlapping of dots, dot gain, etc.

6.2 Limitations

In our current method, there is still much room for improvement. As shown in Figs. 10, 11, 12, to identify the color (or its corresponding hatching) of a region, each region should be considerably larger in our method.

One of the problems lies in the design of the shape of zigzag hatching and wave hatching. In the current design, a discontinuity exists when \(\theta_{{{\text{short}}}} = 90\). This may result in two different shapes from the same color because of, for example, round-off errors.

Another problem is the lack of representation of achromatic colors. A simple solution is to convert achromatic colors (colors whose saturation is below a threshold) to another type of hatching, for example cross-hatching.

6.3 Applications

Many printers have a B/W button, and/or their driver windows have a toggle switch between color printing and B/W printing. They enable us to print color documents instantly in grayscale. Their printer output, however, is in conventional grayscale and has the problem discussed in Sect. 2.

If a printer receives page description language commands and also has our Color2Hatch functions in its firmware, pages with uniformly colored regions can be properly hatched in B/W printing. For example, in a page described by Postscript [31], regions surrounded by a closed path are hatched instead of being filled with a color. This is an extended/enforced version of the existing B/W button and achieves better discriminability and toner saving.

Our Color2Hatch can be applied to electronic and conventional papers. Compared to liquid crystal displays, electronic papers are superior in terms of high readability and low power consumption. To achieve high readability, however, many electronic paper devices are monochrome, and their users have difficulty reading color materials. If an electronic paper device has Color2Hatch functions, it can convert color materials to hatched representations in B/W. This will improve the availability and usefulness of electronic paper devices.

6.4 Relation to visualization

Our method is related to glyph-based visualization [32]. As shown in Fig. 11, the segment attached hatching integrated with dashed lines appears to be an iconographic display of multidimensional data [33]. This is reasonable considering that color is a kind of multidimensional data. Based on hatching, however, our alignment of icons/glyphs is regular and appropriate for representing the uniform color of each region.

7 Conclusions

We proposed a novel decolorization method for color business graphics in vector format. Unlike the existing grayscale conversion and texturing methods, our Color2Hatch method is visually clear, provides greater distinguishability, and meets real-world needs even for low-cost printing. Our approach to robust conversion from color to hatching will be useful for saving the printing costs associated with preparation and setup.

One interesting problem is to match the difference (distance) of the two colors and their corresponding hatching from a cognitive perspective. Future work will be applied to non-uniformly colored regions.

We hope that document processors and/or printing systems in the future can instantly prepare B/W printing data from color documents.