Simulation of normal exponential transformation of dark tone images ⋆ Mikola Lutskiv1,†, Petro Shepita1,∗,†, Houda El Bouhissi2,†, Vitaly Lohin1,† and Oleg Yarema3,† 1 Ukrainian Academy of Printing, Pid Goloskom str., 19, Lviv, 79061, Ukraine 2LIMED Laboratory, Faculty of Exact Sciences,University of Bejaia, 06000, Bejaia, Algeria 3Ivan Franko National University of Lviv, Universytetska str., 1, 79000, Ukraine Abstract A mathematical model of the modified ellipsoidal transformation has been developed, incorporating a linear shift that reduces the impact on dark tones and prevents posterization. The model determines the contrast difference between adjacent grey levels and the contrast sensitivity based on typical gradation characteristics, which are derivatives of the gradation characteristic and correspond to human visual perception. Three typical versions of the modified ellipsoidal transformation were created for this study, with their parameters specified. To facilitate problem-solving in MATLAB: Simulink, a structural diagram of the ellipsoidal transformation simulator model, consisting of three main parts, was developed. The modeling results of the ellipsoidal transformation's gradation characteristics are convex curves meeting the initial zero and final unit conditions. These curves exhibit lower steepness at the beginning of the range compared to power gamma transformation characteristics, thus avoiding posterization—a key advantage of the ellipsoidal transformation. The difference between two image elements with varying grey levels was also modeled. Initially, the difference values are zero and then increase rapidly, with the difference curves shifting leftward in dark tones. The maximum values are observed in the range Lno=0.3, with grey levels of E=0.148; 0.276; 0.414. After reaching these maxima, the curves smoothly decrease to zero. Consequently, differences are more pronounced in dark tones at the start of the tone transfer range but significantly smaller in light tones. Contrast sensitivity graphs were also generated, showing initial values of one that peak at 10.0; 6.8; 4.2 units before quickly decreasing. In the range Lno=0.3, the values intersect the unity line and then smoothly approach final values of Ск: 0.64; 0.34; 0.10 units. At the start of the range, high contrast sensitivity in dark tones allows small image details to be well distinguished. Keywords normalized exponential transformation, dynamic range, gradation characteristics, optical density, contrast sensitivity, tone reproduction, black range, gamma transformation, simulation modeling, printing equipment, gradation characteristic, optical density, tonality, contrast sensitivity, quality assessment 1 ICyberPhyS-2024: 1st International Workshop on Intelligent & CyberPhysical Systems, June 28, 2024, Khmelnytskyi, Ukraine ∗ Corresponding author. † These authors contributed equally. lutolen@i.ua (M. Lutskiv); pshepita@gmail.com (P. Shepita); houda.elbouhissi@gmail.com (H. El Bouhissi); pptxua@ukr.net (V. Lohin) oleh.yarema@lnu.edu.ua (O. Yarema) 0000-0002-2921-3662 (M. Lutskiv); 0000-0001-8134-8014 (P. Shepita); 0000-0003-3239-8255 (H. El Bouhissi); 0009-0009-4605-688X (V. Lohin) 0000-0003-3736-4820 (O. Yarema) © 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR ceur-ws.org Workshop ISSN 1613-0073 Proceedings 1. Introduction The investigation into the reproduction of dark tones in printed products plays a pivotal role in ensuring high quality and stability in the production processes of a printing enterprise [1, 2]. Images with proper gradation characteristics are a key element for reproducing realistic, expressive, and high-quality printed impressions and products. It is in the reproduction of dark tones that information is accumulated to create voluminous images, providing depth, contrast, and expressiveness to the visual content [3, 4]. One of the key challenges in reproducing dark tones is posterization - the loss of details and smooth transitions due to a limited dynamic range. Research focused on optimizing the gradation of dark tones proves effective in addressing this issue [5, 6]. High-quality reproduction of dark tones contributes to the creation of images with greater depth and realism, especially crucial when important details are present in dark areas, such as in photographs or medical images [7, 8]. Reproducing the palette of dark tones helps enhance the contrast and clarity of text and details on printing materials. Research aimed at improving the reproduction of dark tones finds application in various fields, including photography, design, and more [9]. Thus, studying and optimizing the reproduction of dark tones in printing not only enhances the visual aesthetics of printed products but also expands the possibilities and efficiency of utilizing digital technologies in modern printing [10]. 2. Problem Setting Digital image processing for printing aims to ensure the quality of the printed image as perceived by the human visual system. The image quality depends on various factors and is assessed by the distribution of tones in ranges, optical density, contrast, contrast sensitivity, etc [7, 8]. Different methods of digital image processing for printing often yield low quality in the presence of various disturbances and distortions [1, 2]. Graphic editors such as Photoshop are widely used in computer publishing systems to enhance image quality. The primary method for processing and adjusting the tone of an image in the spatial domain involves using the Curves tool [5, 10]. Operators (designers, technologists) observe the digital image on the monitor screen in the absence of the original one. In the working window, they create a gradation characteristic with the Curves tool using a mouse [11]. Therefore, adjustments are made at the operator's discretion, depending on experience and skill, leading to suboptimal image quality [12]. It is worth noting that adjusting the gradation characteristic, mostly based on gamma transformation, has several drawbacks and distorts the image, especially in the dark range, limiting its application for correcting dark tones [13]. Therefore, the development of a mathematical model for normalized exponential transformation of dark tones images is a relevant task for practical application. 3. Analysis of recent research and publications There are a variety of algorithms and methods for improving image quality in the spatial domain, which can be categorized into the following main classes [14, 15]: stretching methods, histogram methods, rank methods, and differential methods. The simplest among them are dynamic range stretching methods, both linear and non-linear stretching methods, gradient analytical methods, and gamma correction, which are most commonly applied in practice [5, 6]. The gradation characteristics of many image input (scanners), visualization (monitors), and printing devices correspond to the power law of gamma transformation [16, 17]. The correction procedure is quite straightforward; for example, the output digitized signal L from a scanner needs to be transformed according to a power expression [14]: 𝐿𝐿′ = 𝑘𝑘𝐿𝐿𝜈𝜈 , (1) where L is the unprocessed input image, 'L'' is the transformed output image, k is the scale factor, and ν is the power parameter. If the power parameter (ν) is less than one, the image appears brighter; if it is greater than one, the image appears darker. Gamma transformation is a standard for certain devices such as scanners and monitors [18]. It is worth noting that literature pays little attention to the analysis of power gamma transformation, its properties, and drawbacks. In [5, 19], it is mentioned that in dark areas of the image, the posterization appears — visible bands or transitions that result from the power transformation (1). This limitation affects its capabilities, especially regarding the reproduction of dark tones, making it a significant drawback of power gamma transformation. 4. The goal of the article To develop a model of normalized exponential transformation that allows for the formation of gradient characteristics of dark tones images to enhance their quality. The study involves simulation modeling and analysis of the properties of the proposed model. 5. Presentation of the main research material To develop the model of normalized exponential transformation for digital images of dark tones, the following key points are considered: the input digital image is a linear scale containing 256 gray levels, where the zero level corresponds to black and 255 levels - to white, encompassing various gray tones. For convenience in the overall transformation and processing of digital images, the input and output gray levels are presented in normalized form within a normalized range [20, 21]: 𝐿𝐿 = 𝐹𝐹(𝐿𝐿0 )𝑖𝑖𝑖𝑖 0 ≤ 𝐿𝐿0 ≤ 1 and 0 ≤ L ≤ 1, (2) where, L0- normalized input image, F(L0) - given transformation function. The existing methods of digital image processing are based on stretching the dynamic range of input image elements, relying on the determination and transformation of absolute or relative contrast of brightness values of image elements [22]. These methods are complex and less suitable for preparing images for printing. A method for improving image quality in the spatial domain has been developed, based on range stretching, which relies on defining contrast sensitivity and is described by a nonlinear exponential function. This function better models the distribution of image elements compared to logarithmic and power functions and provides a larger range of contrast sensitivity, derived from the law of light contrast perception. The proposed normalized exponential transformation of dark tone images is described by the expression: 𝐿𝐿 = [𝑒𝑒𝑒𝑒𝑒𝑒(𝑎𝑎𝐿𝐿0 ) − 1]𝑀𝑀, 𝑖𝑖𝑖𝑖 0 ≤ 𝐿𝐿0 ≤ 1𝑎𝑎𝑎𝑎𝑎𝑎 0 ≤ 𝐿𝐿 ≤ 1, (3) where M- scaling coefficient, which provides the limits of expression (3). By setting different values for the coefficient 'a' in expression (3), various variants of gradation characteristics for dark tones of the image can be generated. The contrast sensitivity is expressed by the derivative of the gradation characteristic [23] 𝑑𝑑𝑑𝑑 (4) 𝐶𝐶 = , 𝑑𝑑𝐿𝐿0 Contrast sensitivity characterizes the human eye's ability to distinguish brightness. The higher the contrast sensitivity, the better details of the image can be discerned within a given range of tonal reproduction. If the gradation characteristic of the generated exponential image (3) is known, then based on the given expression (2), we can determine the optical density of the transformed image: 𝐷𝐷 = 2,5 − 𝑙𝑙𝑙𝑙𝑙𝑙10(1 + 𝐿𝐿 ⋅ 255) , (5) where 2,5 is the nominal value of optical density, and the one (number) is given for the initial zero offset. Contrast sensitivity (equation 4) and optical density (equation 5) are used to assess the properties of exponential transformation. For example, based on expression (3), three typical variants of normalized exponential transformation of dark tone images have been processed by setting the coefficient a to 1.0, 2.0, and 3.0. As a result, three expressions for typical exponential transformations are obtained, presented by the expression (4): 𝐿𝐿1 = [𝑒𝑒𝑒𝑒𝑒𝑒(1 ⋅ 𝐿𝐿0 ) − 1]𝑀𝑀1 , (6) 𝐿𝐿2 = [𝑒𝑒𝑒𝑒𝑒𝑒(2 ⋅ 𝐿𝐿0 ) − 1]𝑀𝑀2 , (7) 𝐿𝐿3 = [𝑒𝑒𝑒𝑒𝑒𝑒(3 ⋅ 𝐿𝐿0 ) − 1]𝑀𝑀3 𝑖𝑖𝑖𝑖 0 ≤ 𝐿𝐿_0 ≤ 1, (8) Based on the provided information and expressions (4)-(8), along with the principles of simulation modeling in the Matlab Simulink package, a structural diagram of a 4-channel simulator for exponential transformation of dark tone images has been developed and is presented in Figure 1. The ‘Ramp’ block generates a linear scale L0, which is parallelly applied to the inputs of the mathematical function blocks Fcn-Fcn2 [20, 24]. In the dialogue windows of these blocks, programs are written (expressions (6)-(8), that calculate three variants of exponential transformation L1, L2, L3. These values are then input into the multiplexer ‘MUX’ and visualized by the ‘Scope’ and ‘Display’ blocks. Simultaneously, they are applied to the inputs of the mathematical function blocks F_cn3-F_cn5. In the dialogue windows of these blocks, a program is written (expression (5) for calculating the optical density of power transformation images D1-D3. These values are then input into the multiplexer and visualized by the ‘Scope’ and ‘Display’ blocks. For comparison, the optical density D0 of the linear scale L0 is determined. The contrast sensitivity of the exponential transformation is determined using the ‘Derivative’ blocks and visualized by the ‘Scope2’ and ‘Display2’ blocks [18]. Figure 1: Structural diagram of the simulator model for exponential transformation of dark tone images. 6. Presentation research results The simulator's mathematical function blocks Fcn-Fcn2 are configured with the coefficient a set to 1.0, 2.0, and 3.0. In interactive mode, the simulator's scale is adjusted: M1=0,581; M2=0,15652; M3=0,0524. The results of the simulation of gradation characteristics of the normalized exponential transformation are presented in Figure 2. Figure 2: Gradation characteristics of the normalized exponential transformation The first gradation characteristic is a straight line. The gradation characteristics are smoothly curved and uniformly shifted downwards. The second characteristic L1 corresponds to the coefficient a set to 1.0, the third - a set to 2.0, and the fourth - a set to 3.0. It is worth noting that at the beginning of the dark range, where L0=0.20 , the values of the output levels L are 0.20, 0.129, 0.077, 0.043. Therefore, the exponential transformation effectively stretches the black range of images compared to traditional gamma transformations. The results of the simulation modeling of the optical density of images using the developed exponential transformation for different coefficients a are presented in Figure 3. Figure 3: The results of the simulation modeling of the optical density of images using the developed exponential transformation The characteristics of optical density are descending concave curves, well-stretched in both dark and light ranges, with initial values of 2.45 and final values of 0.09 units. The bottom characteristic corresponds to the optical density D0 of the linear scale. The next characteristic of optical density corresponds to the exponential transformation L_1 with a coefficient a1=1,0. The upper characteristic of optical density corresponds to the transformation L_1 with a coefficient a2=3,0. It's worth noting that the characteristics of optical density at the beginning of dark tones where L0=2.0 are well-stretched, and the values of optical density are 1.429, 1.186, 0.97, 0.784 units. Therefore, exponential transformation effectively stretches the black range of images compared to traditional gamma transformations. The results of the simulation modeling of the contrast sensitivity of exponential transformation for different coefficients a are presented in Figure 4. Figure 4: Characteristics of the contrast sensitivity of exponential transformation The initial values of contrast sensitivity are 0.589, 0.319, and 0.1619 units, gradually increasing. Around L0=0.6, they intersect the unit line, steadily increasing and approaching final values of 1.579, 2.304, 3.139 units. The exponential transformation L1 with a coefficient a=1.0 has the highest contrast sensitivity. It is noteworthy that the linear scale L0 has a contrast sensitivity of one throughout the entire tonal transmission interval. For comparison, the difference between the formed gradation characteristics of exponential transformation and the linear scale L0 has been determined: 𝐸𝐸 = 𝐿𝐿𝑖𝑖 − 𝐿𝐿0 , 𝑖𝑖𝑖𝑖 𝑖𝑖 = 1, 2, 3. (9) The scheme is located in the lower part of the simulator model in Figure 1. The results of simulation modeling for the difference between the formed gradation characteristics of exponential transformation and the linear scale are presented in Figure 5. Figure 5: Graphs of the differences between the gradation characteristics of exponential transformation and the linear scale The difference graphs are U-shaped and slightly shifted to the right. The upper curve corresponds to the gradation characteristic L1, and the lower one corresponds to L3. The minimum values of differences are -0.1232, -0.235, -0.336 levels. It's noteworthy that the differences are uniformly distributed in height, further confirming the effective stretching of the image in the tonal reproduction range. The results of the conducted research can be applied in computer publishing systems for adjusting dark tone images in preparation for printing. Conclusions A mathematical model for the normalized modified ellipsoidal transformation of images has been developed, incorporating a linear shift. This model defines the difference contrast and contrast sensitivity for light tones, enabling the determination and construction of the transformation's gradation characteristics, difference contrast characteristics, and contrast sensitivity within the interval [0 ≤ Ln << 1], along with an analysis of their properties. A structural diagram of a three-channel simulator for the modified ellipsoidal transformation has been created in the MATLAB: Simulink package. This simulator allows for the formation and construction of various gradation characteristics, difference contrast graphs, and contrast sensitivity graphs, facilitating both qualitative and quantitative evaluations essential for preparing digital images for printing. The modeling results for the gradation characteristics of typical light tone options in the ellipsoidal transformation are presented as convex curves that meet the initial zero and final unit conditions of the transformation. These curves exhibit lower steepness at the beginning of the range compared to power gamma transformation characteristics, thus preventing posterization—a significant advantage of the modified ellipsoidal transformation. The graphs of differences between two adjacent image elements are shown, starting at zero, rapidly increasing to maximum values (Em = 0.148, 0.276, 0.414) around Lno = 0.32, and then gradually decreasing to zero. It is found that these differences are more pronounced in dark tones at the beginning of the tone transfer range but decrease sharply in light tones. The contrast sensitivity graphs for typical options of the ellipsoidal transformation show initial values of one, which quickly rise to maximum values (Cmax: 10.0; 6.8; 4.0 units). At the start of the range, the contrast sensitivity is high in dark tones, making small image details more distinguishable. It is established that the relative change in sensitivity across dark and light tones is approximately the same, indicating that the ellipsoidal transformation is characterized by contrast sensitivity. This effectively quantifies the human visual system's response to brightness changes over a limited interval. References [1] Y. Ding, G. Sun, Stereoscopic Image Quality Assessment, Springer Singapore Pte. Limited, 2021. [2] Y.-P. Wang, Q. Wu, K. R. Castleman, Image Enhancement, у: Microscope Image Processing, Elsevier, 2023, с. 55–74. doi:10.1016/b978-0-12-821049-9.00006-x. [3] J. Yoo, D. Lee, C. Son, S. Jung, B. Yoo, C. Choi, J.-J. Han, B. Han, RaScaNet: Learning Tiny Models by Raster-Scanning Images, у: 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, 2021. doi:10.1109/cvpr46437.2021.01346. [4] H. Song, M. Xu, L. Yang, L. Zhang, S. Yan (Ред.), Innovative Technologies for Printing, Packaging and Digital Media, Springer Nature Singapore, Singapore, 2024. doi:10.1007/978- 981-99-9955-2. [5] T. Hovorushchenko, S. Aleksov, S. Talapchuk, O. Shpylyuk, and V. Magdin, “Overview Of The Methods And Tools For Situation Identification And Decision-Making Support In The Cyberphysical System «Smart House»”, CSIT, no. 4, pp. 20–26, Dec. 2022. [6] P. S. Rajakumar, S. Geetha, T. V. Ananthan, Fundamentals of Image Processing, Jupiter Publications Consortium, 2023. doi:10.47715/jpc.b.978-93-91303-80-8. [7] D. Di Maio, J. Baqersad (Ред.), Rotating Machinery, Optical Methods & Scanning LDV Methods, Volume 6, Springer International Publishing, Cham, 2023. doi:10.1007/978-3-031- 04098-6. [8] L. Yan, H. Zhao, Y. Lin, Y. Sun, Math Physics Foundation of Advanced Remote Sensing Digital Image Processing, Springer Nature Singapore, Singapore, 2023. doi:10.1007/978- 981-99-1778-5. [9] A. Dlesk, K. Vach, K. Pavelka, Photogrammetric Co-Processing of Thermal Infrared Images and RGB Images, Sensors 22.4 (2022) 1655. doi:10.3390/s22041655. [10] B. Durnyak, M. Lutskiv, G. Petriaszwili, P. Shepita, Analysis of raster imprints parameters on the basis of models and experimental research, у: 10th International Symposium on Graphic Engineering and Design, University of Novi Sad, Faculty of technical sciences, Department of graphic engineering and design,, 2020. doi:10.24867/grid-2020-p42. [11] B. Durnyak, M. Lutskiv, P. Shepita, R. Karpyn, V. Sheketa, M. Pasieka, Modelling of Tone Reproduction with Round Raster Elements in a Short Printing System of Parallel Structure, у: Advances in Computer Science for Engineering and Education, Springer International Publishing, Cham, 2022, с. 37–46. doi:10.1007/978-3-031-04812-8_4. [12] B. Durnyak, M. Lutskiv, P. Shepita, D. Hunko, N. Savina Formation of linear characteristic of normalized raster transformation for rhombic elements (2021) CEUR Workshop Proceedings, 2853, pp. 127 – 133 [13] J. Yoo, D. Lee, C. Son, S. Jung, B. Yoo, C. Choi, J.-J. Han, B. Han, RaScaNet: Learning Tiny Models by Raster-Scanning Images, у: 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, 2021. doi:10.1109/cvpr46437.2021.01346. [14] E. Alzaghoul, M. B. Al-Zoubi, R. Obiedat, F. Alzaghoul, Applying Machine Learning to DEM Raster Images, Technologies 9.4 (2021) 87. doi:10.3390/technologies9040087. [15] R. Nichols, Mastering Adobe Photoshop Elements 2023: Bring Out the Best in Your Images Using Adobe Photoshop Elements 2023, Packt Publishing, Limited, 2022. [16] S. Balovsyak, S. . Voropaieva, V. . Horditsa, K. . Odaiska, and Y. . Tanasyuk, “Software And Hardware For Determining Gaussian Noise Level In Images”, CSIT, no. 1, pp. 45–53, Apr. 2022. [17] J. Yoo, D. Lee, C. Son, S. Jung, B. Yoo, C. Choi, J.-J. Han, B. Han, RaScaNet: Learning Tiny Models by Raster-Scanning Images, у: 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, 2021. doi:10.1109/cvpr46437.2021.01346. [18] L. Samaniego Jr., L. C. De Jesus, J. Apostol, D. Betonio, J. D. Medalla, S. Peruda Jr., S. G. Brucal, E. Yong, Carabao Mango Export Quality Checker Using MATLAB Image Processing, Int. J. Comput. Sci. Res. 7 (2023) 2080–2094. doi:10.25147/ijcsr.2017.001.1.145. [19] X. Feng, G. Liang, W. Pei, X. Gao, Wavelet Denoising Image Processing Based on MATLAB, Acad. J. Sci. Technol. 6.2 (2023) 12–17. doi:10.54097/ajst.v6i2.9436. [20] A. Baskar, M. Rajappa, S. K. Vasudevan, T. S. Murugesh, Edge Detection: From a Clear Perspective, у: Digital Image Processing, Chapman and Hall/CRC, Boca Raton, 2023, с. 73– 106. doi:10.1201/9781003217428-4. [21] A. Baskar, M. Rajappa, S. K. Vasudevan, T. S. Murugesh, Image Processing Fundamentals, у: Digital Image Processing, Chapman and Hall/CRC, Boca Raton, 2023, с. 23–60. doi:10.1201/9781003217428-2. [22] E. Alzaghoul, M. B. Al-Zoubi, R. Obiedat, F. Alzaghoul, Applying Machine Learning to DEM Raster Images, Technologies 9.4 (2021) 87. doi:10.3390/technologies9040087. [23] A. I. Ivon, V. F. Istushkin, V. O. Belugina, SOFTWARE FOR SCANNING THE BRIGHTNESS OF THE RASTER IMAGES PIXELS, Syst. Technol. 1.144 (2023) 13–19. doi:10.34185/1562- 9945-1-144-2023-02. [24] W. Zapka, Inkjet Printing in Industry, Wiley, 2022. doi:10.1002/9783527828074. [25] S. Sessa, F. D. Martino, Fuzzy Transforms for Image Processing and Data Analysis: Core Concepts, Processes and Applications, Springer International Publishing AG, 2021.