1 Introduction

Usually a lossy image compression method is used for coding/decoding images, like, for example, JPEG. These methods are generally used for inserting images in WEB pages and for capturing images by digital cameras. The advantage in terms of sizes of the image obtained with a strong compression rate is balanced by a lower quality of the decompressed image and a great loss of information with respect to the original image.

At present time, In many applications, like cloud storage private data protection management in Wang et al. (2016) or video surveillance systems using drones in Uchida et al. (2017), it is necessary to control the quality of the decoded image: generally speaking, using a strong compression rate, high-frequency components are cut in the decoded image. In addition, by setting a priori only the compression rate, we cannot control the quality of the resulting image: for instance, the quality of two decoded images can be very different if two diverse original images are coded under the same compression rate.

We show a new lossy multi-level image compression based on the fuzzy transforms (F-tr), called as MF-transforms (MF-tr). Our aim is to control the quality of the decoded images and to optimize the trade off between the image sizes and quality. In few words, the image is decomposed into more levels disposed as hierarchical structure: each level retains a particular information’s content of the original image which decreases at the successive level. This happens also in other methods like the pyramid compression method (e.g., Toet 1989; Paris et al. 2015; Boiangiu et al. 2016; Ispas and Boiangiu 2017) and the wavelet transform (e.g., Walker and Nguyen 2001; Song 2006; Mallat 2009; Chowdhury and Khathum 2012; Qureshi and Deriche 2016; Khan et al. 2017; Ahanonu et al. 2018; Karthikeyan and Palanisamy 2018).

Furthermore, we intend to improve the performances obtained with the F-tr lossy image compression method proposed in Perfilieva (2006), Di Martino and Sessa (2007), Di Martino et al. (2008) in terms of quality of the decoded image, mainly in Di Martino et al. (2008) the authors show that the quality of the images is better than the one obtained by using the fuzzy relation equation (FEQ) and Discrete Cosine Transform (DCT) algorithms, used in JPEG technique. Here we show that the MF-tr algorithm produces better quality of the decoded images with respect to the F-tr algorithm and Discrete Wavelet Transform (DWT), used in JPEG2K and Embedded Zerotree Wavelet (EZW) techniques.

Lossy image compression methods based on the concept of direct and inverse bi-dimensional F-tr (Di Martino and Sessa 2007; Perfilieva 2007; Di Martino et al. 2008; Perfilieva and Dankova 2008; Perfilieva and de Baets 2010) has been used in many others domains such as image fusion in Di Martino and Sessa (2017), Hodakova et al. (2011), Perfilieva (2007), Perfilieva and Dankova (2008), in image segmentation in Di Martino et al. (2010a), in image reduction in Di Martino et al. (2014), in image watermarking in Di Martino et al. (2012), in video compression in Di Martino et al. (2010b). In Di Martino and Sessa (2007) and Di Martino et al. (2008) the authors show that compression/decompression of images based on F-tr method gives the best results with respect to the ones based on fuzzy relation equations in terms of quality of the image and CPU time. Furthermore, the quality of the images with the F-tr method is comparable with that one obtained using the JPEG method for low values of the compression rate.

The MF-tr is based on a multi-level decomposition of the error, like in image fusion (see.), Perfilieva (2007), Perfilieva and Dankova (2008), Hodakova et al. (2011), Di Martino and Sessa (2017). In this method the error obtained with respect to the source image is measured at every level. The process is iterated until the error is less than or equal to a pre-fixed threshold. In Fig. 1 we show the schema of our MF-tr method.

Fig. 1
figure 1

MF-tr image compression schema

The source image, considered as level 0, is compressed with the direct F-tr and decompressed with the inverse F-tr. The difference between the source and the decompressed image is given by the error at level (1) This process is iterated: at the next iteration the error obtained at level 1 represents the input image, then it is compressed and decompressed and the difference with the decompressed image is given by the error at level (2) The iteration stops if the quality of the reconstructed image, obtained as the sum of the inverse F-tr in every level, is greater or equal than a pre-defined value. We can set a threshold for the quality image by measuring at each decomposition level the Peak Signal to Noise Ratio (PSNR) obtained with the comparison of the reconstructed and the source images.

We adopt the F-tr compression process used in Di Martino and Sessa (2007), Di Martino et al. (2008), in which the original image is divided in blocks. As shown in Di Martino et al. (2010a), b, 2012, 2014), by dividing the image in blocks, we obtain final images with the best quality with respect to those ones obtained using the classical F-tr where the original image is not divided in blocks.

In Sect. 2 we recall the concept of F-tr, in Sect. 3 we present the F-tr image compression method, in Sect. 4 we present our method, in Sect. 5 we show the results of our tests and Sect. 6 is conclusive.

2 The fuzzy transform method

2.1 Fuzzy transforms in one variable

Following the definitions and notations of Perfilieva (2006), let [a, b] be a closed interval, n ≥ 2 and x1, x2, …, xn be points of [a, b], called nodes, such that x1 = a < x2 <⋯< xn = b. We say that an assigned family of fuzzy sets A1, …, An: [a, b] → [0, 1] is a fuzzy partition of [a, b] if the following conditions hold:

  • Ai(xi) = 1 for every i = 1, 2, …, n;

  • Ai(x) = 0 if x is not in (xi−1, xi+1), where we assume x0 = x1 = a and xn+1 = xn = b by comodity of presentation;

  • Ai(x) is a continuous function on [a, b];

  • Ai(x) strictly increases on [xi−1, xi] for i = 2, …, n and strictly decreases on [xi, xi+1] for i = 1, …, n − 1;

  • \(\sum\limits_{{i=1}}^{n} {{A_i}\left( x \right)} =1\) for every x \(\in\) [a,b].

The fuzzy sets {A1, …, An} are called basic functions. Moreover, we say that they form an uniform fuzzy partition if

  • n ≥ 3 and xi = a + h ∙ (i−1), where h = (b−a)/(n−1) and i = 1, 2, …, n (that is, the nodes are equidistant);

  • Ai(xi – x) = Ai(xi + x) for every x \(\in\) [0, h] and i = 2, …, n−1;

  • Ai+1(x) = Ai(x − h) for every x \(\in\) [xi, xi+1] and i = 1, 2, …, n−1.

Now we only deal with the discrete case, that is we know that the function f assumes determined values in some points p1, ..., pm of [a, b]. We assume that the set P of these points is sufficiently dense with respect to the fixed partition, that is for each i = 1, …, n there exists an index j \(\in\) {1, …, m} such that Ai(pj) > 0. Then we can define the n-tuple {F1, …, Fn} as the discrete F-tr of the function f with respect to {A1, A2,…, An}, where each Fi is given by:

$${F_{\text{i}}}=\frac{{\sum\limits_{{j=1}}^{m} {f({p_j}){A_i}({p_j})} }}{{\sum\limits_{{j=1}}^{m} {{A_i}({p_j})} }}$$
(1)

for i = 1,…,n. We define the discrete inverse F-tr of the function f with respect to {A1, A2, …, An} to be the following function defined in the same points p1,..., pm of [a,b]:

$${f_{F,n}}({p_j})=\sum\limits_{{i=1}}^{n} {{F_i}} {A_i}({p_j})$$
(2)

We have the following approximation theorem Perfilieva (2006):

Theorem 1

Let f(x) be assigned on a set P of points p1,..., pm of [a,b]. Then for every ε > 0, there exist an integer n(ε) and a related fuzzy partition {A1, A2, …, An(ε)} of [a, b] such that P is sufficiently dense with respect to {A1, A2, …, An(ε)} and the inequality |f(pj) − fF,n(ε) (pj) | < ε holds true for every pj\(\in\) [a, b], j = 1, …, m.

2.2 Fuzzy transforms in two variables

We can extend the above concepts to functions in two variables. Assume that our universe of discourse is the rectangle [a, b] × [c, d] and let n, m ≥ 2, x1, x2, …, xn\(\in\) [a,b] and y1,y2, …, ym\(\in\) [c, d] be n + m assigned points, called nodes, such that x1 = a < x2 <⋯< xn = b and y1 = c <⋯< ym = d. Furthermore, let A1, …, An : [a, b] → [0, 1] be a fuzzy partition of [a, b] and B1, …, Bm: [c, d] → [0, 1] be a fuzzy partition of [c, d]. In the discrete case, we assume that the function f assumes determined values in some points (pj,qj) \(\in\) [a, b] × [c, d], where i = 1, …, N and j = 1, …, M. Moreover, the sets P = {p1, …, pN} and Q = {q1, … ,qM} of these points are sufficiently dense with respect to the chosen partitions, that is, for each i = 1, …, N there exists an index k \(\in\) {1, …, n} such that Ai(pk) > 0 and for each j = 1, …, M there exists an index l \(\in\) {1, …, m} such that Bj(ql) > 0. Then we define the matrix [Fkl] to be the discrete F-tr of f with respect to {A1, …, An} and {B1, …, Bm} if we have for each k = 1, …, n and l = 1, …, m:

$${F_{{\text{kl}}}}=\frac{{\sum\limits_{{j=1}}^{M} {\sum\limits_{{i=1}}^{N} {f({p_i},{q_j}){A_k}({p_i}){B_l}({q_j})} } }}{{\sum\limits_{{j=1}}^{M} {\sum\limits_{{i=1}}^{N} {{A_k}({p_i}){B_l}({q_j})} } }}$$
(3)

By extending (2) to the case of two variables, we define the discrete inverse F-tr of f with respect to {A1, A2, …, An} and {B1, …, Bm} to be the following function defined in the same points (pj, qj) in [a, b] × [c, d], with i \(\in\) {1, …, N} and j \(\in\) {1, …, M}, as:

$$f_{{nm}}^{F}({p_i},{q_j})=\sum\limits_{{k=1}}^{n} {\sum\limits_{{l=1}}^{m} {{F_{kl}}} {A_k}({p_i})} {B_l}({q_j})$$
(4)

It is possible to show that the following generalization of Theorem 1:

Theorem 2

Let f(x, y) be known on (pj,qj) \(\in\) [a, b] × [c, d], i \(\in\) {1, …, N}, j \(\in\) {1, …, M}. Then for every ε > 0, there exist two integers n(ε), m(ε) and related fuzzy partitions {A1, A2, …, An(ε)} of [a, b] and {B1, B2, …, Bm(ε)} of [c, d] such that the sets of points P = {p1, …, pN} and Q = {q1, … ,qM} are sufficiently dense with respect to {A1, A2, …, An(ε)} and {B1, B2, …, Bm(ε)} and the following holds true for every (pj,qj) \(\in\) [a, b] × [c, d], i \(\in\) {1, …, N} and j \(\in\) {1, …, M}:

$$\left| {f({p_i},{q_j}) - f_{{n(\varepsilon )m(\varepsilon )}}^{F}({p_i},{q_j})} \right|<\varepsilon$$
(5)

3 F-transforms in two variables for image compression

Let I be a grey image of M × N sizes and Lt be the scale of grey levels, with I(i,j) = P(i,j)/Lt, seen as I: (i, j) \(\in\) {1, …, M}×{1, …, N} → [0, 1], I(i, j) being the normalized value of the pixel P(i, j). For brevity, we put pi = i, qj = j, a = c = 1, b = N, d = M. We suppose that A1, …, Am : [1, M] → [0,1] (resp., B1, …, Bn : [1, N] → [0, 1]) with m < M (resp., n < N), form a fuzzy partition of [1, M] (resp., [1, N]). Then I is divided in sub-matrices IC of M(C) × N(C) sizes (IC : (i, j) \(\in\) {1, …, M(C)×{1, …, N(C)} → [0,1]), defined as blocks compressed to blocks C of sizes m(C) × n(C) (with m(C) < M(C), n(C) < N(C)) via the discrete F-tr [\(F_{{kl}}^{C}\)] given by:

$$F_{{kl}}^{C}=\frac{{\sum\limits_{{j=1}}^{{N(C)}} {\sum\limits_{{i=1}}^{{M(C)}} {{I_C}(i,j){A_k}(i){B_l}(j)} } }}{{\sum\limits_{{j=1}}^{{N(C)}} {\sum\limits_{{i=1}}^{{M(C)}} {{A_k}(i){B_l}(j)} } }}$$
(6)

for each k = 1, …, m(C) and l = 1, …, n(C). As above, naturally we do in such a way that the set{1, …, M(C) (resp., {1, …, N(C)}) is sufficiently dense to the fuzzy partition {A1, …, Am(C)} (resp., {B1, …, Bn(C)}) defined in [1, M(C)] (resp., [1, N(C)]). Then we decode the blocks with the inverse F-tr \(I_{{m(C)n(c)}}^{F}\):{1, …, M(C)}×{1, …, N(C)} → [0,1] defined as:

$$I_{{m(C)n(C)}}^{F}(i,j)=\sum\limits_{{l=1}}^{{n(C)}} {\sum\limits_{{k=1}}^{{m(C)}} {F_{{kl}}^{C}{A_k}(i){B_l}(j)} }$$
(7)

which approximates IC with arbitrary precision in the sense of Theorem 2, that is there exist certainly two integers n(C) = n(C,ε), m(C) = m(C,ε) and ε > 0 for every block C such that the inequality

$$\left| {{I_C}(i,j) - I_{{m(C)n(C)}}^{F}} \right|<\varepsilon$$
(8)

holds true for every (i, j) \(\in\) {1, …, M(C)}×{1, …, N(C)}. Practically speaking, we assign several values to n(C) and m(C) with m(C) < M(C), n(C) < N(C) and hence to the compression rate ρ(C) = (m(C) ∙ n(C))/(M(C) ∙ N(C)). Here we use (cfr., [6, 7, 8]) the fuzzy sets A1, …, Am(C) :[1,M(C)]◊[0,1] and B1,…,Bn(C) :[1,N(C)]◊[0,1] defined as

$${A_1}(i)=\left\{ \begin{gathered} 0.5\left(\cos \frac{\pi }{h}(i - 1)+1\right)\quad{\text{ if i }} \in {\text{ [1,}}{{\text{x}}_{\text{2}}}{\text{]}} \hfill \\ 0{\text{ otherwise}} \hfill \\ \end{gathered} \right.$$
$${A_k}(i)=\left\{ \begin{gathered} 0.5\left(\cos \frac{\pi }{h}(i - {x_k})+1\right)\quad{\text{ if i }} \in {\text{ [}}{{\text{x}}_{{\text{k-1}}}}{\text{,}}{{\text{x}}_{{\text{k}}+{\text{1}}}}{\text{] }} \hfill \\ 0{\text{ otherwise}} \hfill \\ \end{gathered} \right.$$
(9)
$$\begin{gathered} {\text{ }} \hfill \\ {A_{m(C)}}(i)=\left\{ \begin{gathered} 0.5\left(\cos \frac{\pi }{h}(i - {x_{m(C) - 1}})+1\right)\quad{\text{ if i }} \in {\text{ [}}{x_{m(C) - 1}}{\text{,}}M{\text{(C)]}} \hfill \\ 0{\text{ otherwise}} \hfill \\ \end{gathered} \right.{\text{ }} \hfill \\ \end{gathered}$$

where k = 2,…, m(C), h = (M(C)–1)/(m(C)–1), xk = 1+ h·(k-1) and

$${B_1}(j)=\left\{ \begin{gathered} 0.5\left(\cos \frac{\pi }{s}(j - 1)+1\right)\quad{\text{ if j }} \in {\text{ [1,}}{{\text{y}}_{\text{2}}}{\text{]}} \hfill \\ 0{\text{ otherwise}} \hfill \\ \end{gathered} \right.$$
$${B_t}(j)=\left\{ \begin{gathered} 0.5\left(\cos \frac{\pi }{s}(j - {y_t})+1\right)\quad{\text{ if j}} \in {\text{ [}}{{\text{y}}_{{\text{t-1}}}}{\text{,}}{{\text{y}}_{{\text{t}}+{\text{1}}}}{\text{] }} \hfill \\ 0{\text{ otherwise}} \hfill \\ \end{gathered} \right.$$
(10)
$${B_{n(C)}}(j)=\left\{ \begin{gathered} 0.5\left(\cos \frac{\pi }{s}(j - {y_{n(C) - 1}})+1\right)\quad{\text{ if j}} \in {\text{[}}{{\text{y}}_{{\text{n}}\left( {\text{C}} \right) - 1}},N(C)] \hfill \\ 0{\text{ otherwise}} \hfill \\ \end{gathered} \right.$$

where t = 2, …, n(C), s = (N(C)–1)/(n(C)–1), yt = 1+ s·(t–1).

4 The MF-transform image process

We consider a grey-level image I of sizes N × M at level 0. In order to control the quality of the reconstructed image with respect to the original one, we put a threshold value for the PSNR index defined as

$$PSNR=20{\log _{10}}\frac{{L{t^{}}}}{{MSE}}$$
(11)

where MSE stands for the Mean Square Error defined as

$$MSE=\frac{{\sum\limits_{{i=1}}^{N} {\sum\limits_{{j=1}}^{M} {{{(I_{{}}^{{(h)}}(i,j) - {I_0}(i,j))}^2}} } }}{{N \times M}}.$$
(12)

Lt can assume at most the value 255 in an 8-bit grey pixel depth image. If I = I(0) is the original image, I(h) is the decoded image, obtained at the hth level, given as:

$$I_{{}}^{{(h)}}=\left\{ \begin{gathered} {I^{(1)}}\quad{\text{ if h }}={\text{ 1}} \hfill \\ \sum\limits_{{r=1}}^{{h - 1}} {I_{F}^{{(r)}}={I^{(h - 1)}}+} {\text{ }}I_{F}^{{(h)}}\quad{\text{ if h }}>{\text{ 1}} \hfill \\ \end{gathered} \right.$$
(13)

where \(I_{F}^{{(h)}}\) is the inverse F-tr calculated at the hth level. We obtain \(I_{F}^{{(h - 1)}}={I^{(h - 1)}} - {I^{(h - 2)}}\)if \(h \geqslant 2\) and \(I_{F}^{{(1)}}={I^{(1)}} - {I^{(0)}}\). Figure 2 schematizes the reconstruction process.

Fig. 2
figure 2

Schema of the images reconstructed at each level

If the PSNR calculated at each level is greater or equal than the threshold, the process stops otherwise we consider the next level. We use the F-tr compression process described in Sect. 2.2, dividing the image in blocks of dimensions n × m. Each block is compressed via (6) and decompressed via (7). The inverse F-tr \(I_{F}^{{(h)}}\)at the hth level is obtained by merging all the decompressed blocks. In our algorithm the process stops when at least one of the next three conditions is true:

  • the PSNR value is greater than a threshold PSNRth;

  • the difference between the PSNR at the hth level and the PSNR at the (h-1)th level is less than a difference threshold DIFFPSNRth;

  • the current level reaches a maximal level hmax.

We add the second condition because the DIFFPSNRth value decreases by increasing the hth level. Hence it is reasonable to stop the process when the image quality obtained at a certain level differs in minimum quantity if compared to that one obtained at the (h−1)th level. The third condition is added in order to stop the process after hmax iterations if the first two conditions are false. As schematized in the coding/decoding pseudocode below, the conditional statement in the step 15) is necessary because in the first iteration (h = 1) the value of the variable DIFFPSNR must be set to a value greater than the difference threshold DIFFPSNRth. We denote with \(I_{D}^{{(1)}}\)\(I_{D}^{{(h)}}\) the direct F-tr obtained at each level.

figure a
figure b

5 Test results

For our tests we have considered a sample of grey images taken from the USC-SIPI Image Database (http://sipi.usc.edu/database/). We perform our tests by using a Intel Core i7-59360X processor with a clock frequency of 3 GHz.

For measuring the performances of the MF-tr algorithm, we compare it with the classical F-tr, FEQ, DCT, DWT, JPEG, JPEG2K algorithms. In these comparison we measure the PSNR and the CPU time obtained applying each algorithm. For brevity, we only give the results for three images of this sample. In the first experiment the grey image Lena of sizes 256 × 256 (Fig. 3a) is divided in blocks of sizes 4 × 4 compressed in blocks of sizes 2 × 2 (ρ = 0.25). At the 1st level the PSNR is 28.410 and we set PSNRth = 30, DIFFPSNRth = 0.1. Thus both thresholds are reached at the 5th level (Fig. 3b). In Fig. 3c, e, g, i (resp., d, f, h, l) we show the decoded images (rep., corresponding errors) obtained at the 1st, 2nd, 3rd, 4th level.

Fig. 3
figure 3

a The original image Lena, b. Final decoded image at 5th level. c. Decoded image at 1st level. d. Error at 1st level. e. Decoded image at 2nd level. f. Error at 2nd level. g. Decoded image at 3rd level. h. Error at 3rd level. i. Decoded image at 4th level. l. Error at 4th level

In Table 1 we show the PSNR obtained for each level. The column DIFFPSNR shows the difference between the PSNRs obtained at the hth and (h−1)th levels.

Table 1 PSNR obtained at each level for the image Lena (ρ = 0.25)

In the next experiment the grey image Leopard of sizes 256 × 256 (Fig. 4a) is divided in blocks of sizes 4 × 4 compressed in blocks of sizes 2 × 2 (ρ = 0.25). At the 1st level the PSNR is 24.675 and we set PSNRth = 26, DIFFPSNRth = 0.1. Thus both thresholds are reached at the 3rd level (Fig. 4b). In Fig. 4a we show the original image. In Fig. 4b we show the resulting image obtained at the 2nd level. Fig. 4c, e (resp., d, f) show the decoded images (resp., corresponding errors) obtained at the 1st, 2nd level.

Fig. 4
figure 4

a The original image Leopard. b Final decoded image at 3rd level. c Decoded image at 1st level. d Error at 1st level. e Decoded image at 2nd level. f Error at 2nd level

In Table 2 we show the PSNR obtained for each level. The column DIFFPSNR shows the difference between the PSNRs obtained at the hth and (h−1)th levels.

Table 2 PSNR obtained at each level for the image Leopard (ρ = 0.25)

In the next experiment the grey image “11” of sizes 512 × 512 (Fig. 5a) is divided in blocks of sizes 4 × 4 compressed in blocks of sizes 2 × 2 (ρ = 0.25). At the 1st level the PSNR is 30.412. We set PSNRth = 32 and DIFFPSNRth = 0.1. These thresholds are reached at the 3rd level. In Fig. 5a we show the original image. In Fig. 5b we show the decoded image obtained at the 4th level. Fig. 5c, e, g (resp., d, f, h) show the decoded images (resp., corresponding errors) obtained at the 1st, 2nd, 3rd level.

Fig. 5
figure 5

a The original image 11. b Final decoded image at 4th level. c Decoded image at 1st level. d Error at 1st level. e Decoded image at 2nd level. f Error at 2nd level. g Decoded image 3rd level. h Error at 3rd level

In Table 3 we show the PSNR obtained for each level. The column DIFFPSNR shows the difference between the PSNRs obtained at the hth and (h-1)th levels. Table 4 shows the CPU time required with the F-tr and MF-tr methods for decoding the original images.

Table 3 PSNR obtained at each level for the image “11” (ρ = 0.25)
Table 4 CPU time in ms obtained for the images Lena, Leopard and “11”

In Table 5 (resp., 6, 7) we show the mean CPU time obtained for all 256 × 256 (resp., 512 × 512, 1024 × 1024) grey images of the above database by varying the final level. In the 3rd column we show the ratio between the total CPU time and the final level.

Table 5 Mean CPU time varying the final level for images of sizes 256 × 256

Tables 5, 6 and 7 show that this ratio decreases by increasing the final level. Indeed the results show the CPU mean time is 0.5 s (resp., 1 s) for images of sizes 256 × 256 (resp., 512 × 512 and 1024 × 1024) by performing a decomposition up to the eighth level. In other words, the MF-tr method can be considered a good compromise between the quality of the reconstructed image and the time necessary for its reconstruction.

Table 6 Mean CPU time varying the final level for images of sizes 512 × 512
Table 7 Mean CPU time varying the final level for images of sizes 1024 × 1024

By sake of completeness, comparison experiments are made with other image compression methods for measuring the performances of the MF-tr algorithm in terms of quality of the reconstructed image by means of the PSNR. Indeed we consider the grey levels of the error images at each level and apply the Huffman encoding to maximize the compression. For brevity, we show the PSNR obtained for the 256 × 256 grey image Lena in Table 8. The second column shows the dimension in bytes of the direct F-tr at any level, the third column shows the dimension in bytes of the sum of all the direct F-tr until to the lth level. The compression rate ρ is given by the ratio between the number of bytes of the sum of the directed F-tr and the number of bytes necessary to store the original images. The 4th, 5th, 6th columns show the PSNR in the MF-tr, JPEG and JPEG2K methods, respectively and in the 8th (resp., 9th) the percentage gain PSNR of the JPEG (resp., JPEG2K) with respect to the MF-tr, respectively defined as:

%Gain (JPEG over MF-tr) = (PSNR JPEG – PSNR MF-tr)/PSNR MF-tr.

%Gain (JPEG2K over MF-tr) = (PSNR JPEG2K – PSNR MF-tr)/PSNR MF-tr.

Table 8 PSNR comparisons for the image Lena (MF-tr, JPEG and JPEG2K)

These results show that the PSNR gain percentage obtained by using the JPEG and JPEG2K algorithms with respect to the MF-tr algorithm decreases by increasing the levels. This trend is shown also for the other grey images in the dataset. The results in Table 9 show that the gain percentage of PSNR, obtained by using the MF-tr algorithm with respect to FEQ, DCT, DWT algorithms, increases by increasing the compression rate, that is increasing the levels considered in the MF-Ftr algorithm. This trend is shown also for the other grey images in the dataset. In the FEQ compression method we used the Lukasiewicz t-norm and the related residuum operators. In the DCT algorithm the image is partitioned in 8 × 8 size blocks. In the DWT algorithm at each level the HH, LH and HL coefficients are discarded, whereas the LL coefficients are transformed into the successive level. The best results are obtained by using the MF-tr algorithm The DWT algorithm gives better results with respect to the FEQ and DCT algorithms. The gain percentage of PSNR for the image Lena are defined as.

%Gain (MF-tr over FEQ) = (PSNR MF-tr – PSNR FEQ) / PSNR FEQ.

%Gain (MF-tr over DCT) = (PSNR MF-tr – PSNR DCT) / PSNR DCT.

%Gain (MF-tr over DWT) = (PSNR MF-tr – PSNR DCT) / PSNR DWT.

Table 9 PSNR comparison and MF-tr gain with respect FEQ, DCT and DWT for image Lena

In Fig. 6 we show the mean trends of the three gain percentages by varying the compression rate.

Fig. 6
figure 6

Trend of the gain percentages of MF-tr with respect to FEQ, DCT, DWT

In Tables 10 and 11 we show the mean coding and decoding CPU times, respectively, obtained for the 256 × 256 grey images in the dataset applying the MF-tr, F-tr, FEQ, DCT and DWT algorithms.

Table 10 Mean coding CPU time for 256 × 256 grey images in several methods
Table 11 Mean decoding CPU time for 256 × 256grey images in several methods

These results show that the CPU time obtained by using the MF-tr algorithm are averagely acceptable. Both the mean coding and decoding CPU times calculated by using the MF-tr algorithm are better than the corresponding ones in the DWT algorithm, independently from the compression rate.

Figures 7 and 8 show the trend of the coding and the decoding CPU time, respectively, calculated in seconds by using the MF-tr and DWT algorithm. These trends highlight the benefits in terms of CPU time in the coding and decoding processes of the MF-tr algorithm with respect to the DWT algorithm, regardless of the compression rate.

Fig. 7
figure 7

Trend of the coding CPU time of MF-tr (in red) with respect to DWT (in green)

Fig. 8
figure 8

Trend of the decoding CPU time of MF-tr (in red) with respect to DWT (in green)

6 Conclusions

Lossy image compression algorithms are used in many disciplines in which a loss of information in the reconstructed image is considered acceptable. The drawback of the F-tr method consists in the fact that they does not allow to set in advance the quality of the reconstructed image, but only its compression rate. The MF-tr algorithm is a multi-level compression image technique that uses the F-tr algorithm for coding and decoding the input image at each level. The user can set a PSNR threshold for controlling the quality of the reconstructed image. This characteristic makes the MF-tr method usable also in the cases where it is necessary to guarantee a high quality of the reconstructed image, such as, for example, in video surveillance or environmental control systems.

The results show that the CPU time (necessary for reconstructing the final image) is acceptable and the coding/decoding time decreases by increasing the number of the levels. Moreover, comparisons show that the PSNR gain percentage obtained by using the MF-tr algorithm is better than the corresponding ones obtained by using F-tr, FEQ, DCT, DWT algorithms. The quality of the decoded image is not comparable with the ones obtained by using the JPEG ad JPEG2K techniques, but the PSNR gain percentage of the JPEG and JPEG2K techniques diminishes by increasing the number of levels. In future researches the quality of the decoded image will be improved by integrating the MF-tr algorithm with specific quantization and entropy encoding algorithms, moreover such method shall be dedicated to other topics like segmentation and image fusion. In the future we intend to build a fragile watermarking algorithm based on the MF-tr method in order to apply it in a cloud storage environment to protect the privacy of sensitive images. This fragile watermarking system will be based on the schema proposed in Di Martino et al. (2010a) in which we apply the MF-tr method controls the quality of the marked stored images.