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

SUGISAKAMASANORI

Research Article

Generation of Labyrinth Images Using Gradients Between
Circles in Window
Toru Hiraoka, Kyosuke Matsumoto

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

ARTICLE INFO

Non-photorealistic rendering methods to automatically generate labyrinth images fromphotographic images have been proposed. Labyrinth images are non-photorealistic images thatmaze-like intricate lines are laid out at approximately equal intervals on photographic images.
Since the shape of the lines forming labyrinth images differs depending on the conventional
method, it gives a different impression. We propose a method to generate labyrinth images
composed of lines with a shape different from the conventional methods. The proposed method
is performed by iterative computation with gradients between circles in a window. To verify theeffectiveness of the proposed method, experiments were conducted to visually confirm labyrinth
images generated from various photographic images.

Article History
Received 20 May 2024
Accepted 29 May 2024
Keywords
Non-photorealistic renderingLabyrinth image
Photographic image
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/)

edges, and curved lines along the edges and circular lines,
respectively. Since different impressions can be given bydifferent shapes of lines in labyrinth images, there is ademand for a method to generate labyrinth images
composed of lines of other different shapes.
In this paper, we propose a method to generate
labyrinth images that straight lines of the conventional
method [8] are converted into smoother curved lines. The
proposed method can generate lines with many bends
close to right angles along the edges as well as theconventional method [8]. The proposed method is
performed by iterative computation with gradients
between circles in a window.
This paper is organized as follows: the second section
describes the proposed method to generate labyrinthimages from photographic images, the third section
shows experimental results and reveals the effectivenessof our method, and the conclusion of this paper is givenin the fourth section.

1. Introduction
The advent of non-photorealistic rendering (NPR) [1], [2],[3], [4], [5], [6] in the 1990s created an interesting new
field that favored representation, abstraction andstylization against traditional computer graphics forphotorealism. By lifting the burden of realism, NPR isable to provide users with compelling and uniquerepresentations through abstraction and stylization.
Many artistic and visual styles are enabled by NPR.
Many methods [7], [8], [9], [10] have been proposed
to automatically generate labyrinth images fromphotographic images in one of NPRs. Labyrinth images
are non-photorealistic images that maze-like intricatelines are laid out at approximately equal intervals on
photographic images. The lines forming labyrinth imagesof the conventional methods have different shapes.
Labyrinth images of the conventional methods [7], [8],[9], [10] consists of horizontal and vertical straight lines,
straight lines that preserve the edges and have many
bends that are close to right angles, curved lines along the2. Proposed method

Corresponding author’s E-mail: hiraoka@sun.ac.jp

153

(𝑡𝑡)

The proposed method is implemented in three steps using
gray-scale photographic images as input. Step 1
computes the gradients between the circles in the window.
Step 2 transforms the photographic images using thegradients computed in Step 1. Steps 1 and 2 are computed
repeatedly. Step 3 generates labyrinth images using therepeatedly calculated results. The flow chart of computed
method is shown in Fig. 1.

(𝑡𝑡)

𝑈𝑈 − 1, and 𝑓𝑓𝑖𝑖,𝑗𝑗 must be set to 0 if 𝑓𝑓𝑖𝑖,𝑗𝑗 is less than0.
Step 3: Steps 1 and 2 are repeated 𝑇𝑇 times. The pixel
(𝑇𝑇)
(𝑇𝑇)
values 𝑓𝑓𝑖𝑖,𝑗𝑗 must be set to 𝑓𝑓𝑖𝑖,𝑗𝑗 if 𝑓𝑓𝑖𝑖,𝑗𝑗 is greater
(𝑇𝑇)
(𝑇𝑇)
than (𝑈𝑈 − 1)/2, and 𝑓𝑓𝑖𝑖,𝑗𝑗 must be set to 0 if 𝑓𝑓𝑖𝑖,𝑗𝑗
is less than or equal to (𝑈𝑈 − 1)/2. An image(𝑇𝑇)composed of the pixel values 𝑓𝑓𝑖𝑖,𝑗𝑗 is a labyrinth
image.
2. Experiments
Two experiments were conducted. The first experimentwith changing the values of the parameters in theproposed method was conducted using Woman image
shown in Fig. 2, and the way of generation of labyrinth
patterns was confirmed visually. The second experiment
was conducted using various photographic images shownin Fig. 3, and labyrinth images were confirmed visually.
All photographic images used in the experiments
comprised 512 * 512 pixels and 256 gradations.

Fig 1 Flow chart of our method
The detailed procedure of the proposed method is asfollows.
Step 0: The input pixel values for the coordinates (𝑖𝑖, 𝑗𝑗) ofa grayscale photographic image are denoted by𝑓𝑓𝑖𝑖,𝑗𝑗 . The pixel values 𝑓𝑓𝑖𝑖,𝑗𝑗 have values of 𝑈𝑈
gradation from 0 to 𝑈𝑈 − 1. The pixel values of theimage at the 𝑡𝑡 -th iteration number are denoted by(𝑡𝑡)(0)𝑓𝑓𝑖𝑖,𝑗𝑗 , where 𝑓𝑓𝑖𝑖,𝑗𝑗 = 𝑓𝑓𝑖𝑖,𝑗𝑗 .
(𝑡𝑡)Step 1: The circle averages 𝑎𝑎𝑘𝑘,𝑖𝑖,𝑗𝑗 of the pixel values(𝑡𝑡−1)
𝑓𝑓𝑖𝑖,𝑗𝑗of the pixels whose distance is greater thanor equal to 𝑘𝑘(= 0, 1, 2, ⋯ , 𝐾𝐾) and less than 𝑘𝑘 + 1(𝑡𝑡)
are calculated. The values 𝑔𝑔𝑘𝑘,𝑖𝑖,𝑗𝑗 are calculated(𝑡𝑡)from the circle averages 𝑎𝑎𝑘𝑘,𝑖𝑖,𝑗𝑗 in the following
equation:
(𝑡𝑡)
(𝑡𝑡)
(𝑡𝑡)
𝑔𝑔𝑘𝑘,𝑖𝑖,𝑗𝑗 = 𝑎𝑎𝑘𝑘,𝑖𝑖,𝑗𝑗 − 𝑎𝑎𝑘𝑘+1,𝑖𝑖,𝑗𝑗(1)(𝑡𝑡)
where 𝑘𝑘 in 𝑔𝑔𝑘𝑘,𝑖𝑖,𝑗𝑗 is an integer value from 0 to(𝑡𝑡)𝐾𝐾 − 1. The gradients 𝑔𝑔𝑖𝑖,𝑗𝑗 are calculated from the(𝑡𝑡)values 𝑔𝑔𝑘𝑘,𝑖𝑖,𝑗𝑗 in the following equation:(𝑡𝑡)𝑔𝑔𝑖𝑖,𝑗𝑗 =(𝑡𝑡)∑𝐾𝐾−1
𝑘𝑘=0 𝑔𝑔𝑘𝑘,𝑖𝑖,𝑗𝑗 (𝑘𝑘+1)∑𝐾𝐾−1
𝑘𝑘=0 (𝑘𝑘+1)

Fig 2 Woman imageFig. 3 Various photographic images
2.1. Experiment with changing parameters
Labyrinth images generated by changing the value of theparameter 𝑇𝑇 were visually confirmed using Woman
image. The value of 𝑇𝑇 was set to 5, 10, 20 and 40. The
values of the parameters 𝐾𝐾 and 𝛼𝛼 were set to 4 and 6,respectively. Labyrinth images generated under these
conditions are shown in Fig. 4. As the value of 𝑇𝑇 waslarger, labyrinth patterns became clearer and wereexpressed finely.
Labyrinth images generated by changing the value ofthe parameter 𝐾𝐾 were visually confirmed using Woman
image. The value of 𝐾𝐾 was set to 3, 4, 5 and 6. The values

(2)

(𝑡𝑡)
Step 2: The pixel values 𝑓𝑓𝑖𝑖,𝑗𝑗 are calculated from the(𝑡𝑡)input pixel values 𝑓𝑓𝑖𝑖,𝑗𝑗 using the gradients 𝑔𝑔𝑖𝑖,𝑗𝑗 inthe following equation:
(𝑡𝑡)
(𝑡𝑡)
𝑓𝑓𝑖𝑖,𝑗𝑗 = 𝑓𝑓𝑖𝑖,𝑗𝑗 + 𝛼𝛼𝑔𝑔𝑖𝑖,𝑗𝑗(3)
where 𝛼𝛼 is a positive constant. The pixel values
(𝑡𝑡)
(𝑡𝑡)
𝑓𝑓𝑖𝑖,𝑗𝑗 must be set to 𝑈𝑈 − 1 if 𝑓𝑓𝑖𝑖,𝑗𝑗 is greater than154

(a) 𝑇𝑇 = 5(a) 𝛼𝛼 = 4(b) 𝑇𝑇 = 10(c) 𝛼𝛼 = 8(d) 𝛼𝛼 = 10Fig. 6 Labyrinth images generated by changing theparameter 𝛼𝛼(c) 𝑇𝑇 = 20(d) 𝑇𝑇 = 40Fig. 4 Labyrinth images generated by changing theparameter 𝑇𝑇(a) 𝐾𝐾 = 3(b) 𝛼𝛼 = 6of the parameters 𝑇𝑇 and 𝛼𝛼 were set to 40 and 6,
respectively. Labyrinth images generated under these
conditions are shown in Fig. 5. The larger the value of 𝐾𝐾,
the larger labyrinth patterns.
Labyrinth images generated by changing the value ofthe parameter 𝛼𝛼 were visually confirmed using Womanimage. The value of 𝛼𝛼 was set to 4, 6, 8 and 10. The
values of the parameters 𝑇𝑇 and 𝐾𝐾 were set to 40 and 4,respectively. Labyrinth images generated under these
conditions are shown in Fig. 6. The larger the value of 𝛼𝛼,
the more bending of labyrinth patterns.

(b) 𝐾𝐾 = 4

2.2. Experiment using various photographic images
The proposed method was applied to four photographic
images shown in Fig. 3. The values of the parameters 𝑇𝑇,
𝐾𝐾 and 𝛼𝛼 were set to 40, 4 and 6, respectively. Labyrinth
images generated under these conditions are shown in Fig.
7. All labyrinth images had lines with many bends closeto right angles along the edges and had smoother curvedlines than the conventional method [8].

(c) 𝐾𝐾 = 5(d) 𝐾𝐾 = 6Fig. 5 Labyrinth images generated by changing theparameter 𝐾𝐾

155

References
1. P. Haeberli. Paint by numbers: abstract imagerepresentations. ACM SIGGRAPH Computer Graphics,
1990, 24(4): 207-214.
2. J. Lansdown and S. Schofield. Expressive rendering: areview of nonphotorealistic techniques. IEEE ComputerGraphics 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 and
H. Winnemoller, NPRportrait 1.0: A three-level
benchmark 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. A. Sparavigna and B. Montrucchio. Non-photorealistic
image rendering with a labyrinthine tiling. Cornell
University Library, 2006, arXiv:cs/0609084.
8. T. Hiraoka, H. Nonaka and Y. Tsurunari. A high-speed
method for generating labyrinth images using smoothingfilters with different window sizes. ICIC Express Letters,2019, 13(8): 711-717.
9. T. Hiraoka. Generation of edge-enhancing labyrinth
images using inverse filter and two improved Laplacian
filters. ICIC Express Letters, 2020, 14(2): 121-127.
10. T. Hiraoka and Y. Tsurunari. Generation of maze-like
images by bilateral filter and unsharp mask in HLS color
space. ICIC Express Letters, 2021, 15(10): 1053-1059.

Fig. 7 Labyrinth images
3. Conclusions
We proposed a new NPR method to automaticallygenerate labyrinth images from photographic images.
The proposed method was performed by iterative
computation with gradients between circles in a window.
To visually confirm labyrinth images generated by theproposed method, we conducted an experiment using
various photographic images. As a result of theexperiment, labyrinth images had lines with many bends
close to right angles along the edges and had smoothercurved lines than the conventional method [8].
Additionally, we conducted an experiment to visually
verify how labyrinth images changed by changing thevalues of the parameters in the proposed method.
Future studies include extending the proposed method
to applications involving color photographic images,videos, and three-dimensional data.

Authors Introduction
Dr. Toru Hiraoka

Acknowledgment
This work was supported by JSPS KAKENHI Grant
Number JP23K11727 and The Telecommunications
Advancement Foundation Grant.

156

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.

Mr. Kyosuke Matsumoto
He is a student in the Graduate Schoolof Regional Design and Creation,
University of Nagasaki. His researchinterests inculede regional platform
and image processing.

157