Proceedings, APSIPA Annual Summit and Conference 2020

7-10 December 2020, Auckland, New Zealand

Two-Layer Lossless Coding of HDR Images
Specialized for Radiance Format
Kai Yang∗ , Taizo Suzuki∗ , and Taichi Yoshida†∗ University of Tsukuba, Ibaraki, Japan

E-mail: yang@wmp.cs.tsukuba.ac.jp, taizo@cs.tsukuba.ac.jp† The University of Electro-Communications, Tokyo, Japan
E-mail: t-yoshida@uec.ac.jp

Abstract—Two-layer coding of high dynamic range (HDR)
images, which consists of a base layer for encoding the tonemapped low dynamic range (LDR) image and an enhancement
layer for encoding the residual signals between LDR and HDRimages, is a constructive solution as a coding framework thatcan simultaneously provide the LDR and HDR images. This
study proposes a two-layer coding that greatly improves thecompression performance while satisfying the reversibility for theRadiance format of HDR images. Specifically, in the enhancement
layer, the image is decomposed into mantissa and exponential
information by utilizing the integer conversion (RGBE converter)of the Radiance format and the luminance and chrominancecomponents of the residual signals are sparsified by the proposed
exponent-adjusted mantissa prediction. The experimental resultsof HDR image coding show that the proposed method improved
the average bitrate by 1.41 bpp compared with the best existing
method thanks to the specialized scheme to the Radiance format.

I. I NTRODUCTION
High dynamic range (HDR) image, which has a high contrast ratio between the maximum luminance and the minimum
luminance of the image, has been widely used in many fields
such as photography, computer graphics, and filming [1], [2].
However, since most existing devices cannot display HDR
images accurately, a technology called tone mapping [3–8] thatmaps an HDR image to a low dynamic range (LDR) image
with 24-bit full color information is essential. On the otherhand, inverse tone mapping, which transforms an LDR image
into an HDR image, also plays an important role in two-layer
coding of HDR images described later.
The Radiance and OpenEXR formats [9], [10] that represent
floating point numbers have been mainly used to encode HDR
images. To compress the HDR images more efficiently, Xuet al. proposed a logarithmic method that encodes an HDR
image with the JPEG 2000 after logarithmically converting
it from floating-point numbers to an integers [11]. However,it does not guarantee true reversibility of HDR images due
to calculation loss. Also, the Radiance format, OpenEXR
format, and logarithmic method require a new tone mappingarchitecture to provide LDR images for most existing devices.
Recently, two-layer coding of HDR images, already employed by the international standard JPEG XT, is becoming
mainstream [12–15]. It consists of a base layer for encoding
the tone-mapped LDR image and an enhancement layer for

978-988-14768-8-3/20/$31.00 ©2020 APSIPA

encoding the residual signals between the HDR and LDR
images and has two properties as follows:
Image selectivity: LDR images can be provided to generalusers while providing HDR images to high-end users suchas photographers, designers, and medical staff.
• Backward compatibility: Arbitrary general coders such as
JPEG and JPEG 2000 can be directly used in the coderparts with almost no modification.
•In addition to the above properties, the reversibility of HDRimages can also be realized when both the integer conversion
and coder in the enhancement layer are reversible.
As previous studies on two-layer coding, Mai et al. proposeda tone mapping optimization method to compress an HDR
image efficiently at the expense of quality of the tone-mapped
LDR image [12]. On the other hand, several methods, whichallow any tone mapping and inverse tone mapping, have been
introduced [13–15]. Watanabe et al. employed the histogram
packing (HP) method [16] in the enhancement layer based on
the framework of JPEG XT (referred as “basic method”) andthe lossy logarithmic method [13]. Iwahashi et al. presented areversible integer conversion instead of the lossy logarithmic
method to guarantee reversibility [14]. In addition, Yoshida etal. compressed the energy of the residual signals efficiently by
the HP method and the adaptive inverse tone mapping (globalapproximation and gradation prediction) in the enhancement
layer while guaranteeing reversibility based on the integer
conversion of JPEG XR [15]. However, in the Yoshida’s
method, the performance on the Radiance format was not as
good as on the OpenEXR format and the gradation prediction
requires high computational cost on the decoder.
This study proposes an efficient two-layer coding of HDR
images that guarantees reversibility and has better compression
performance for the Radiance format. Specifically, in theenhancement layer, the image is decomposed into mantissa
and exponential information by utilizing the integer conversion(RGBE converter) of the Radiance format and the luminanceand chrominance components of the residual signals are sparsified by the proposed exponent-adjusted mantissa prediction.
Of course, the computational cost on the decoder is not highunlike the gradation prediction in the Yoshida’s method. The
experimental results show that the proposed method achieves
higher compression performance than the conventional ones

1118

APSIPA-ASC 2020

Proceedings, APSIPA Annual Summit and Conference 2020

7-10 December 2020, Auckland, New ZealandFig. 1. Structure of the Radiance format.

without any loss in the entire process.
Notation: When A is an image (a component) and p (or q,
whose total number is a quarter of one of p) is a pixel indexof A, A(p) (or A(q)) is the p-th (or q-th) pixel value of A. ⌈·⌉,⌊·⌋, and |·|2 are the ceil function, floor function, and L2 -norm,respectively.

Fig. 2. Encoder of the basic encoder: IC, TM, ITM, Enc-1, Dec-1, and Enc-2
are integer converter, tone mapping, inverse tone mapping, lossy encoder forthe tone-mapped LDR image, decoder related to Enc-1, and lossless encoder
for the residual signals, respectively.

II. P REPARATION
C. Basic Method of Two-Layer Coding of HDR Images

A. Radiance Format
The Radiance format (extension “.hdr”) [9] is a formatof total 32-bit per pixel (bpp) representation, where 8 bits
are assigned to each mantissa and exponential information(Fig. 1). By eliminating the sign bit and sharing the exponent
part, each channel can be encoded efficiently. Its integer andinverse conversions (RGBE and rgb converters) are defined asfollows:
E(p) = ⌈log 2 (max(m(p)) + 128)⌉,⌋⌊
256 × m(p),M (p) =2E(p)−128
M (p) + 0.5 E(p)−128m(p) =2,256(1)(2)(3)

where E, M ∈ {R, G, B}, and m ∈ {r, g, b} are the exponent
value, mantissa (integer color) value, and the floating pointcolor value, respectively. The conversed information E andM are further losslessly compressed from 32 bpp by the runlength coding.
B. Encoder of JPEG 2000
JPEG 2000 is one of the most efficient image compression
standards. At the encoder, RGB values are first decorrelated toYCbCr space by a reversible color transform (RCT) as follows:⌋⌊
R + 2G + B
Y =,
(4)
4
Cb = B − G,(5)
Cr = R − G,(6)

where Y , Cb , and Cr denote the luminance and chrominancecomponents. Then, each component is separately decorrelated
to LL component (low frequency component in both horizontal and vertical directions), HL component (high frequencycomponent in the vertical direction), LH component (highfrequency component in the horizontal direction), and HHcomponent (remaining high frequency components) by the
5/3-tap discrete wavelet transform (5/3-DWT). After that, they
are encoded by EBCOT. Note that the preprocessing (RCT and5/3-DWT) affects the compression performance.

Two-layer coding of HDR images consists of the base andenhancement layers. In the base layer, an HDR image isconverted to an LDR image by tone mapping and encoded bya general lossy encoder such as JPEG. In the enhancement
layer, the predicted HDR image is generated by decoding
and inverse tone mapping from the tone-mapped LDR image
encoded in the base layer and the residual signals between thelogarithmically-converted HDR and the predicted HDR images
are encoded by a general lossless encoder such as JPEG 2000
lossless mode. Let “basic method” be one that introduced thelogarithmic conversion [11] to integer converters in the JPEG
XT-based framework as shown in the Fig. 2. Unfortunately,in such two-layer coding, reversibility cannot be guaranteed
because the calculation loss occurs according to the lossy
logarithmic conversion. Its entire compression performance iseven worse than the conventional one-layer coding such as theRadiance format, OpenEXR format, and logarithmic method.
III. T WO -L AYER L OSSLESS C ODING OF HDR I MAGESS PECIALIZED FOR R ADIANCE F ORMATIn this section, a two-layer coding that greatly improves
the compression performance while satisfying the reversibility
for the Radiance format of HDR images is proposed. The
proposed method has two strategies, RGBE converter for theinteger converter and exponent-adjusted mantissa prediction.
Fig. 3 shows the encoder of the proposed method.
A. RGBE Converter for Integer Converter
Unlike the basic method, the proposed method is basedon the Radiance format and uses the RGBE converter in (1)and (2) as integer converters. The use of the RGBE converter
contributes to reduce the amount of information from 16 bits to8 bits for each color. In addition, E tends to approach a certainvalue, indicating relatively small amount of information. Thergb converter in (3) is also used as the inverse conversion.
B. Exponent-adjusted Mantissa Prediction
1) Basic Strategy: The compression performance is further
improved by incorporating a mantissa prediction based on thedecomposition with the RGBE converter as shown in Fig. 3.
As shown in (2), E has a very large effect on M . Therefore,1119

Proceedings, APSIPA Annual Summit and Conference 2020

7-10 December 2020, Auckland, New ZealandFig. 3. Encoder of the proposed method: RC, EMP, TM, ITM, Enc-1, Dec-1, and Enc-2 are RGBE converter, exponent-adjusted mantissa prediction, tone
mapping, inverse tone mapping, encoder for the tone-mapped LDR image, decoder for LDR image, and lossless encoder for the residual signals, respectively.

Here, we sparsify the chrominance components by adjusting
the exponential information in (8) via reducing the L2 normbb and C
br represented as follows:of C√∑
2,bb |2 =ee|C|(B(p) − B(p))− (G(p) − G(p))|(12)
pFig. 4. Preprocessing in encoder of JPEG 2000 lossless mode in the enhancement layer.

br |2 =|C√∑2.
ee|(R(p) − R(p))− (G(p) − G(p))|(13)

pfor better compression performance, we consider predicting M
in the enhancement layer by adjusting E. First, the predictedf ∈ {R,e G,e B}
e in the enhancement
mantissa information M
layer is expressed as follows:⌊⌋ef(p) = 256 × m(p)M,(7)
2EeM (p)−128eM ∈ {EeR , E
eG , EeB } are the manwhere me ∈ {r′ , g ′ , b′ } and E
tissa and exponential information obtained with the inverse
tone mapping of LDR images in the base layer. By using theunknown value εM ∈ {εR , εG , εB } that produces the wellpredicted mantissa information, (7) is rewritten by⌊⌋ef(p) = 256 × m(p)M.
(8)2E(p)+εM −128
εM , which has only 32 bits, is transmitted as side information.
2) Adjustment Considering Encoder: We apply JPEG 2000
lossless mode to a coder in the enhancement layer in accordance with the previous studies [13–15].1 Since the preprocessing greatly affects the compression performance as
described in Section II-B, we adjust εM by considering thosetransforms. Fig. 4 shows the preprocessing in the encoder ofJPEG 2000 lossless mode in the enhancement layer.
In the enhancement layer, the luminance and chrominancebb , and C
br of the residual signals are obtained
components Yb , C
as follows:⌊⌋e + 2(G − G)e + (B − B)e(R − R)b
Y =,(9)4bb = (B − B)e − (G − G),eC
br = (R − R)e − (G − G).
eC
1 The other coders can also be applied.

(10)
(11)

Similar to the above chrominance components, the L2 normof the HH components are represented as follows:√∑|HHYb |2 =|HHYb (q)|2 ,(14)q|HHCbb |2 =√∑|HHCbb (q)|2 ,(15)|HHCbr (q)|2 ,(16)q|HHCbr |2 =√∑qwhere HHYb , HHCbb , and HHCbr denote the HH components ofbb , and C
br , respectively. Consequently, εM is calculated
Yb , Cas follows:
br |2 + w(2)|Cbb |2arg min(w(1)|CεM+ w(3)|HHYb |2 + w(4)|HHCbr |2 + w(5)|HHCbb |2 ),(17)
where w(k)s are weight factors.
The bitstreams of the tone-mapped LDR image, εM , E,and residual signals are stored and transmitted to the decoder.
By applying the rgb conversion in (3) to the RGBE components obtained with the inverse processing of the transmitted
bitstreams, the original HDR image is completely restored.
IV. E XPERIMENTAL R ESULTS
For the test images, we used 36 full-color HDR images(Radiance format) cropped from the database in [17] to asize of 1024 × 1536. In order to measure the compression
performance, the bitrate was used as objective index. It
indicates that the smaller bitrate is the better compression
performance. For each method, we applied the Reinhard’s
method [3] for the tone mapping, the Huo’s method [18] forthe inverse tone mapping, JPEG (quality factor Q = 85) for1120

Proceedings, APSIPA Annual Summit and Conference 2020

7-10 December 2020, Auckland, New Zealand

TABLE IL OSSLESS CODING RESULTS ( BITRATE [ BPP ]).
Image
img1
img2
img3
img4
img5
img6
img7
img8
img9
img10
img11
img12
img13
img14
img15
img16
img17
img18
img19
img20
img21
img22
img23
img24
img25
img26
img27
img28
img29
img30
img31
img32
img33
img34
img35
img36
Average

Radiance
27.13
26.34
27.04
23.89
26.67
23.80
24.00
24.21
26.75
23.37
26.55
24.95
25.05
24.59
25.57
26.18
25.18
27.32
24.96
25.15
24.78
24.98
24.63
25.17
25.12
25.79
25.57
25.89
25.20
24.32
25.70
25.79
24.50
24.58
25.20
24.85
25.30

Basic
29.90
26.73
34.16
28.23
30.99
25.47
27.18
27.79
27.52
28.42
28.14
30.43
30.43
30.50
30.84
32.74
31.63
31.33
31.79
24.34
26.48
29.71
28.23
29.68
30.80
29.01
27.30
28.92
30.25
29.77
26.09
26.82
30.58
29.50
29.44
24.87
29.06

[13]
27.09
23.79
32.01
25.38
28.23
22.70
24.24
24.89
24.58
25.56
25.23
27.54
27.68
27.34
28.05
29.98
28.82
28.59
28.93
21.44
23.71
27.41
25.37
26.84
27.78
26.07
24.46
26.14
27.50
26.92
23.06
23.96
27.66
26.74
26.50
22.28
26.23

[15]
19.95
15.55
18.05
16.91
20.36
15.30
12.27
11.26
18.44
13.64
18.49
12.63
13.10
13.35
14.00
16.56
13.90
18.81
14.21
14.15
14.16
14.65
11.76
13.48
13.54
19.55
17.37
16.36
15.65
11.88
15.38
17.05
12.78
12.76
11.96
14.15
15.09

Prop.1
20.25
17.74
18.83
13.64
20.74
15.10
13.08
11.89
17.69
13.71
18.75
13.97
14.31
14.92
16.24
18.34
16.17
20.84
15.34
14.31
15.32
15.74
13.11
14.52
15.30
18.66
16.92
17.56
16.85
13.77
16.36
17.13
14.37
15.19
13.96
15.05
15.99

for the integer converter and the exponent-adjusted mantissa
prediction. The proposed method almost always provided thebetter compression performance than conventional methodswhile guaranteeing reversibility and improved the average
bitrate by 1.41 bpp compared with the best existing method.

Prop.2
17.18
14.65
16.68
12.81
18.35
12.87
11.34
10.33
15.44
11.69
16.17
11.83
12.25
12.45
13.70
15.50
13.58
17.81
13.38
12.33
13.05
12.95
11.04
12.11
12.44
15.81
14.22
15.02
14.28
12.81
14.30
14.50
12.42
12.40
11.65
13.03
13.68

R EFERENCES

the base layer coder, and JPEG 2000 lossless mode for theenhancement layer coder. Let Prop. 1 and 2 be the proposed
methods with only the RGBE converter for integer converterand with both of the RGBE converter for integer converter
and the exponent-adjusted mantissa prediction, respectively.
The proposed methods were compared with the basic method,
Watanabe’s method [13], and Yoshida’s method [15] in losslesscoding.
The experimental results are shown in Table I. Note thatthe basic method and Watanabe’s method are not exactly
lossless due to calculation loss in the logarithmic method.
The proposed methods not only guarantee reversibility but
also outperformed the conventional methods for almost allimages. Especially, the Prop. 2 improved the average bitrateby 1.41 bpp compared with Yoshida’s method, which is thebest existing method. Since the Prop. 2 always showed better
performance compared with the Prop. 1, it is clear that theexponent-adjusted mantissa prediction had a significant effecton the compression performance improvement.

[1] E. Reinhard, W. Heidrich, P. Debevec, S. Pattanaik, G. Ward, andK. Myszkowski, High Dynamic Range Imaging: Acquisition, Display,and Image-based Lighting, Morgan Kaufmann, 2010.
[2] F. Banterle, A. Artusi, K. Debattista, and A. Chalmers, Advanced HighDynamic Range Imaging, AK Peters/CRC Press, 2017.
[3] E. Reinhard, M. Stark, P. Shirley, and J. Ferwerda, “Photographic tonereproduction for digital images,” ACM Trans. Graph., vol. 21, no. 3,pp. 267–276, July 2002.
[4] E. Reinhard, “Parameter estimation for photographic tone reproduction,”
J. Graph. Tools, vol. 7, no. 1, pp. 45–51, Nov. 2002.
[5] B. Gu, W. Li, M. Zhu, and M. Wang, “Local edge-preserving multiscaledecomposition for high dynamic range image tone mapping,” IEEE
Trans. Image Process., vol. 22, no. 1, pp. 70–79, Aug. 2012.
[6] Z. Li and J. Zheng, “Visual-salience-based tone mapping for highdynamic range images,” IEEE Trans. Ind. Electron., vol. 61, no. 12,pp. 7076–7082, Mar. 2014.
[7] K. Ma, H. Yeganeh, K. Zeng, and Z. Wang, “High dynamic range image
compression by optimizing tone mapped image quality index,” IEEETrans. Image Process., vol. 24, no. 10, pp. 3086–3097, May 2015.
[8] S. Paris, S.W. Hasinoff, and J. Kautz, “Local Laplacian filters: Edgeaware image processing with a Laplacian pyramid,” ACM Trans. Graph.,vol. 30, no. 4, pp. 68, Mar. 2015.
[9] G. Ward, Graphics Gems II, chapter Real Pixels, pp. 80–85, 1991.
[10] R. Bogart, F. Kainz, and D. Hess, “OpenEXR image file format,” inProc. ACM SIGGRAPH, San Diego, CA, Jan. 2003.
[11] R. Xu, S.N. Pattanaik, and C.E. Hughes, “High-dynamic-range stillimage encoding in JPEG 2000,” IEEE Comput. Graph. Appl., vol. 25,
no. 6, pp. 57–64, Nov. 2005.
[12] Z. Mai, H. Mansour, R. Mantiuk, P. Nasiopoulos, R. Ward, and W. Heidrich, “Optimizing a tone curve for backward-compatible high dynamic
range image and video compression,” IEEE Trans. Image Process., vol.
20, no. 6, pp. 1558–1571, Dec. 2010.
[13] O. Watanabe, H. Kobayashi, and H. Kiya, “Lossless two-layer coding
using histogram packing technique for HDR images,” in Proc. ISCAS,Florence, Italy, May 2018, pp. 1–5.
[14] M. Iwahashi, T. Yoshida, N.B. Mokhtar, and H. Kiya, “Bit-depth scalable
lossless coding for high dynamic range images,” EURASIP J. Adv. Signal
Process., vol. 2015, no. 22, pp. 1–15, Mar. 2015.
[15] T. Yoshida, M. Iwahashi, and H. Kiya, “Two-layer lossless coding forhigh dynamic range images based on range compression and adaptive
inverse tone-mapping,” IEICE Trans. Fundamentals, vol. 101, no. 1, pp.
259–266, Jan. 2018.
[16] A.J. Pinho, “An online preprocessing technique for improving thelossless compression of images with sparse histograms,” IEEE Signal
Process. Lett., vol. 9, no. 1, pp. 5–7, Feb. 2002.
[17] H. Nemoto, P. Korshunov, P. Hanhart, and T. Ebrahimi, “Visual attentionin LDR and HDR images,” in Proc. VPQM, Chandler, AZ, Feb. 2015,
pp. 1–6.
[18] Y. Huo, F. Yang, L. Dong, and V. Brost, “Physiological inverse tone
mapping based on retina response,” The Visual Computer, vol. 30, no.
5, pp. 507–517, Sep. 2014.

V. C ONCLUSION
This study proposed a two-layer coding of HDR images
specialized for the Radiance format with the RGBE converter

1121