Journal of Advances in Artificial Life Robotics
Vol. 4(3); December (2023), pp. 158–162
ON LINE ISSN 2435-8061; ISSN-L 2435-8061
https://alife-robotics.org/jallr.html

SUGISAKAMASANORI

Research Article

GENERATION of Lines-Composed Images that Change
Brightness and Width of Lines
Toru Hiraoka, Jia-Lin Zhang

Graduate School of Regional Design and Creation, University of Nagasaki, JapanABSTRACT

ARTICLE INFO

We propose a non-photorealistic rendering method to automatically generate lines-composed
images from photographic images. The brightness and width of the lines in lines-composed
images change according to the change in the light and dark of photographic images. Our method
is executed by repeating a process of updating images using the area near the target pixel that is
the most different from the area centered on the target pixel. To verify the effectiveness of ourmethod, we conducted experiments with changing the values of parameters in our method. The
experimental results show that our method can generate impressive non-photorealistic images.

Article History
Received 20 May 2024
Accepted 29 May 2024
Keywords
Non-photorealistic renderingLineBrightness
WidthDifferent area
Automatic generation© 2022 The Author. Published by Sugisaka Masanori at ALife Robotics Corporation Ltd.
This is an open access article distributed under the CC BY-NC 4.0 license(http://creativecommons.org/licenses/by-nc/4.0/).

width of the lines change according to the change in thelight and dark of photographic images. In bright areas inphotographic images, black lines are rendered thinnerand brighter, and white lines are rendered wider andbrighter. In dark areas in photographic images, blacklines are rendered wider and darker, and white lines arerendered thinner and darker. Our method is implemented
by an iterative processing using the area near the target
pixel that is the most different from the area centered on
the target pixel. By conducting an experiment using
Lenna image, the appearance of lines-composed images
generated by changing the values of the parameters in ourmethod was visually clarified. In addition, an experiment
was conducted to apply our method to various
photographic images.
As a similar study, methods for generating striped
images [7], [8] and labyrinth images [9], [10], [11], [12]have been proposed. When generating striped images,
Weickert [7] used shock filter, and Hiraoka and Urahama

1. Introduction
Various studies on image processing and computer
graphics have been conducted so far. Among thesestudies are studies on non-photorealistic rendering (NPR)
that combines image processing and computer graphics.
NPR can transmit visual information more effectively,
and can generate images that are enhanced artistry andentertainment from photographic images, videos andthree-dimensional data. Therefore, the non-photorealistic
images are used in television, magazines and websites.
The studies on NPR been conducted since around 1990,and NPR methods for generating non-photorealistic
images of various expressions are currently being
developed [1], [2], [3], [4], [5], [6]. In this paper, wedevelop a method to automatically generate linescomposed images as NPR of an unprecedented
expression from photographic images. Lines-composed
images are represented by lines, and the brightness andCorresponding author’s E-mail: hiraoka@sun.ac.jp158

Step 0: Let the input pixel values on coordinates (𝑖𝑖, 𝑗𝑗) ofa gray-scale photographic image be 𝑓𝑓𝑖𝑖,𝑗𝑗 . The pixelvalues 𝑓𝑓𝑖𝑖,𝑗𝑗 have value of 𝑈𝑈 gradations from 0 to
𝑈𝑈 − 1. Let the pixel values of the 𝑡𝑡-th iteration be(𝑡𝑡)(0)𝑓𝑓𝑖𝑖,𝑗𝑗 , where 𝑓𝑓𝑖𝑖,𝑗𝑗 = 𝑓𝑓𝑖𝑖,𝑗𝑗 .
(𝑡𝑡)Step 1: The difference 𝑑𝑑𝑖𝑖,𝑗𝑗,𝑘𝑘,𝑙𝑙 between the pixel values in
the windows centered on the target pixel (𝑖𝑖, 𝑗𝑗)
and the peripheral pixel (𝑘𝑘, 𝑙𝑙) is computed asfollows.
(𝑡𝑡−1)(𝑡𝑡)(𝑡𝑡−1)
𝑊𝑊𝑑𝑑𝑖𝑖,𝑗𝑗,𝑘𝑘,𝑙𝑙 = ∑𝑊𝑊
𝑚𝑚=−𝑊𝑊 ∑𝑛𝑛=−𝑊𝑊�𝑓𝑓𝑖𝑖+𝑚𝑚,𝑗𝑗+𝑛𝑛 − 𝑓𝑓𝑘𝑘+𝑚𝑚,𝑙𝑙+𝑛𝑛 �(1)where 𝑊𝑊 is the window size, and 𝑚𝑚 and 𝑛𝑛 are thepositions in the window. For all pixels containedin the window of size 𝑊𝑊 centered on the target(𝑡𝑡)
pixel (𝑖𝑖, 𝑗𝑗), the differences 𝑑𝑑𝑖𝑖,𝑗𝑗,𝑘𝑘,𝑙𝑙 are calculated,
and let the maximum value among the differences
(𝑡𝑡)
(𝑡𝑡)
𝑑𝑑𝑖𝑖,𝑗𝑗,𝑘𝑘,𝑙𝑙 be 𝑑𝑑𝑖𝑖,𝑗𝑗,𝑚𝑚𝑚𝑚𝑚𝑚 .
(𝑡𝑡)
Step 2: The pixel values 𝑑𝑑𝑖𝑖,𝑗𝑗,𝑚𝑚𝑚𝑚𝑚𝑚 are smoothed using
pixel values in the window of size 𝑊𝑊. Let the(𝑡𝑡)smoothed pixel values be 𝑠𝑠𝑖𝑖,𝑗𝑗 as follows.

[8] used inverse line convergence index filter. Whengenerating labyrinth images, Pedersen and Singh [9] useddifferential equations, Sparavigna and Montrucchio [10]used tiling, Inoue and Urahama [11] used minimum
spanning trees, and Hiraoka and Tsurunari used bilateralfilter and unsharp mask. Our method uses the method
different from the conventional methods. Although thebrightness and width of striped and labyrinth patterns
generated by the conventional methods are constant, ourmethod can automatically change the brightness andwidth of line patterns according to the change in the lightand dark of photographic images.
The rest of this paper is organized as follows. Section
2 describes our method to generate lines-composed
images from photographic images. Section 3 shows
experimental results, and reveals the effectiveness of ourmethod. Finally, Section 4 concludes this paper.
2. Our method
Our method generates lines-composed images fromgray-scale photographic images. Our method is executedin three steps. In the first step, the area that is the mostdifferent from the area centered on the target pixel isfound from around the target pixel. In the second step,processing using smoothing filter is performed. In thethird step, processing using inverse filter [11], [14], isperformed. Lines-composed images are generated byrepeating the three steps. A flow chart of our method isshown in Fig. 1.

(𝑡𝑡)𝑠𝑠𝑖𝑖,𝑗𝑗 =(𝑡𝑡)𝑊𝑊∑𝑊𝑊
𝑚𝑚=−𝑊𝑊 ∑𝑛𝑛=−𝑊𝑊 𝑑𝑑𝑖𝑖+𝑚𝑚,𝑗𝑗+𝑛𝑛,𝑚𝑚𝑚𝑚𝑚𝑚(2)(2𝑊𝑊+1)2(𝑡𝑡)Step 3: The pixel values 𝑓𝑓𝑖𝑖,𝑗𝑗 are computed using inverse

filter as follows.
(𝑡𝑡)(𝑡𝑡−1)(𝑡𝑡)
𝑓𝑓𝑖𝑖,𝑗𝑗 = 𝑓𝑓𝑖𝑖,𝑗𝑗− 𝑠𝑠𝑖𝑖,𝑗𝑗 + 𝑓𝑓𝑖𝑖,𝑗𝑗
(3)
(𝑡𝑡)
(𝑡𝑡)
where in case 𝑓𝑓𝑖𝑖,𝑗𝑗 is smaller than 0, 𝑓𝑓𝑖𝑖,𝑗𝑗 must be(𝑡𝑡)(𝑡𝑡)
set to 0. In case 𝑓𝑓𝑖𝑖,𝑗𝑗 is greater than 𝑈𝑈 − 1, 𝑓𝑓𝑖𝑖,𝑗𝑗
must be set to 𝑈𝑈 − 1.
By repeating the processing of Step 1 to Step 3 𝑇𝑇
times, an image composed of the pixel values(𝑇𝑇)𝑓𝑓𝑖𝑖,𝑗𝑗 is the lines-composed image.

3. Experiments

We mainly conducted two experiments. The firstexperiment with changing the values of the parameters inour method was conducted using Lenna image shown in
Fig. 2. The second experiment was conducted byapplying our method to four photographic images shownin Fig. 3. All photographic images used in theexperiments were 512 * 512 pixels and 256 gradations.

Fig 1 Flow chart of our method
Fig 2. Lenna image

Details of the procedure in Fig. 1 are explained
below.

159

Fig. 3. Various photographic images
3.1. Experiment with changing parameters
We visually confirmed lines-composed images changed
the value of the iteration number 𝑇𝑇 using Lenna image.
We set the value of 𝑇𝑇 to 5, 10, 15 and 20, and set thevalue of 𝑊𝑊 to 2. The results of the experiment withchanging the value of 𝑇𝑇 are shown in Fig. 4. As the valueof 𝑇𝑇 became large, lines-composed patterns became clear.
The value of 𝑇𝑇 should be 20 to generate clearly linescomposed patterns for photographic images of 512 * 512pixels.

(a) 𝑊𝑊 = 1(b) 𝑊𝑊 = 2(c) 𝑊𝑊 = 3(d) 𝑊𝑊 = 4Fig. 5. Lines-composed images generated by changing
the value of the window size 𝑊𝑊(a) 𝑇𝑇 = 5

3.2. Experiment using various photographic images(b) 𝑇𝑇 = 10Our method was applied to four photographic images
shown in Fig. 3. Since lines-composed patterns werevisually recognized well in the previous experiments, weset the values of the parameters 𝑇𝑇 and 𝑊𝑊 to 20 and 2,respectively. The results of the experiment are shown inFig. 6 In all lines-composed images, lines-composedpatterns could be changed in brightness and width
according to the change in the light and dark ofphotographic images.

(c) 𝑇𝑇 = 15(d) 𝑇𝑇 = 20Fig. 4 Lines-composed images generated by changing
the value of the iteration number 𝑇𝑇

We visually confirmed lines-composed images changed
the value of the window size 𝑊𝑊 using Lenna image. We
set the value of 𝑊𝑊 to 1, 2, 3 and 4, and set the value of 𝑇𝑇
to 20. The results of the experiment with changing thevalue of 𝑊𝑊 are shown in Fig. 5. As the value of 𝑊𝑊 waslarger, lines-composed patterns became wider. The valueof 𝑊𝑊 should be changed according to the usage
application of the users.

160

References
1. P. Haeberli. Paint by numbers: abstract image
representations. ACM SIGGRAPH Computer Graphics,
1990, 24(4): 207-214.
2. J. Lansdown and S. Schofield. Expressive rendering: areview of nonphotorealistic techniques. IEEE Computer
Graphics and Applications, 1995, 15(3): 29-37.
3. J. Correia, L. Vieira, N. Rodriguez-Fernandez, J. Romero
and P. Machado. Evolving image enhancement pipelines.
Artificial Intelligence in Music, Sound, Art and Design,
2021: 82-97.
4. P. L. Rosin, Y. K. Lai, D. Mould, R. Yi, I. Berger, L. Doyle,
S. Lee, C. Li, Y. J. Liu. A. Semmo, A. Shamir, M. Son andH. Winnemoller, NPRportrait 1.0: A three-levelbenchmark for non-photorealistic rendering of portraits.
Computational Visual Media, 2022, 8(3): 445-465.
5. Y. Zhao, D. Ren, Y. Chen, W. Jia, R. Wang and X. Liu.
Cartoon image processing: A survey. International Journalof Computer Vision, 2022, 130(11): 2733–2769.
6. W. Ye, X. Zhu and Y. Liu. Multi-semantic preserving
neural style transfer based on Y channel information ofimage. The Visual Computer, 2023, 39(2): 609-623.
7. J. Weickert. Coherence-enhancing shock filters. Pattern
Recognition Lecture Notes in Computer Science, 2003,2781: 1-8.
8. T. Hiraoka and K. Urahama. Generating striped color
images by inverse line convergence index filter. IIEEJTransactions on Image Electronics and VisualComputing, 2014, 2(2): 190-194.
9. H. Pedersen and K. Singh. Organic labyrinths and mazes.
Proceedings of the 4th International Symposium on NonPhotorealistic Animation and Rendering, 2006: 76-86.
10. A. Sparavigna and B. Montrucchi. Non-photorealistic
image rendering with a labyrinthine tiling. Cornell
University Library, 2006, arXiv:cs/0609084.
11. K. Inoue and K. Urahama. Halftoning with Minimum
spanning trees and its application to maze-like images.
ELSEVIER Computers & Graphics, 2009, 33(5): 638-647.
12. Toru Hiraoka and Yoshihisa Tsurunari. Generation ofmaze-like images by bilateral filter and unsharp mask
in HLS color space. ICIC Express Letters, 2021, 15(10):1053-1059.
13. J. M. Ortega and W. C. Rheinboldt. Iterative solutions ofnonlinear equations in several variables. Society for
Industrial Mathematics, 1987.
14. Z. Yu and K. Urahama. Iterative method for inverse
nonlinear image processing. IEICE Transactions on
Fundamentals, 2014, E97-A(2): 719-721.

Fig. 6. Lines-composed images
4.

Conclusions

We developed an NPR method to automaticallygenerate lines-composed images from gray-scale
photographic images. Our method was executed by an
iterative processing using the area near the target pixelthat is the most different from the area centered on thetarget pixel. To verify the effectiveness of our method,
we visually confirmed lines-composed images bychanging the values of the parameters, and conducted
experiments using various photographic images. As aresult of the experiments, it was clarified that the widthof lines-composed patterns can be changed by changing
the window size in our method. It also was found that ourmethod can change brightness and width of linescomposed patterns according to the change in the lightand dark of photographic images.
A subject for future study is to expand our method for
application to color photographic images, videos andthree-dimensional data.
Acknowledgment
This work was supported by JSPS KAKENHI Grant
Number JP23K11727 and The Telecommunications
Advancement Foundation Grant.

161

Authors Introduction
Dr. Toru Hiraoka

Mr. Jia-Lin Zhang

He received B.Des., M.Des. andD.Eng. degrees from Kyushu
Institute of Design in 1995, 1997 and2005, respectively. He is currently aProfessor in University of Nagasaki.
His research interests include nonphotorealistic rendering and disasterprevention.

He is a student in the Graduate Schoolof Regional Design and Creation,
University of Nagasaki. His researchinterests inculede non-photorealistic
rendering and image processing.

162