**7.2 Using bat-inspired algorithm to enhance fractal image compression**

**Bat's number:** In **Table 3**, we will examine the images of the cameraman and Lena in order to extract the adequate number of bats that will be used in our approach.

**Loudness: Table 4** presents some tests carried out on an additional stress which is loudness, with the objective of taking into consideration the good value for the test.

**Frequency:** The last test table (**Table 5**) is made to pick up the best frequencies that will be used in our algorithm.



**Image Frequency Compression**

*Optimization of Fractal Image Compression DOI: http://dx.doi.org/10.5772/intechopen.93051*

**Table 5.**

Blonde women

Living room

**Table 6.**

**13**

*Testing the image resolutions.*

*Testing different values of frequency.*

**Test image Resolution Compression**

**time (s)**

**time**

**Decompression Time**

 0.458 0.698 1.209 33.576 4.4806 0.442 0.727 1.279 34.284 5.600 0.460 0.738 1.357 29.463 11.990 0.435 0.706 1.422 26.887 15.954 0.453 0.716 1.586 23.701 22.989 0.467 0.702 1.722 23.769 33.415

 0.512 0.735 1.099 35.522 4.947 0.503 0.756 1.228 31.032 11.917 0.514 0.718 1.359 27.649 23.370 0.549 0.745 1.590 23.577 39.059 0.521 0.717 1.850 22.204 50.050 0.646 0.720 2.064 20.869 58.349

> **Decompression time (s)**

Lena 32\*32 0.522 0.704 1.109 5.651 34.695

Cameraman 32\*32 0.467 0.832 1.211 3.628 36.328

Mandrill 32\*32 0.598 0.554 1.211 11.936 31.674

32\*32 0.455 0.692 1.223 9.643 32.645 64\*64 2.581 0.698 1.430 13.100 31.678 128\*128 34.634 0.712 1.712 14.165 30.853 256\*256 811.291 0.763 1.741 13.150 32.065

64\*64 2.193 0.704 1.282 8.722 33.380 128\*128 33.376 0.720 1.486 9.799 32.909 256\*256 732.345 0.763 1.604 9.660 33.115

64\*64 2.608 0.719 1.440 7.743 30.258 128\*128 43.854 0.691 1.658 9.086 31.078 256\*256 732.011 0.977 1.678 9.626 31.095

32\*32 0.558 0.687 1.219 13.475 31.210 64\*64 2.092 0.692 1.355 14.584 31.414 128\*128 26.347 0.710 1.487 14.584 31.322 256\*256 478.219 0.767 1.555 14.138 31.599

64\*64 2.376 0.889 1.422 18.377 30.555 128\*128 22.190 0.732 1.419 18.435 30.582 256\*256 334.636 0.795 1.368 16.404 30.737

Cameraman 20 0.490 0.714 1.118 40.341 1.526

Lena 20 0.495 0.755 1.066 42.199 1.904

**Compression ratio**

**Compression ratio**

**MSE PSNR (dB)**

**PSNR MSE**

**Table 3.** *Testing the number of bats.*

As we can see from the previous tables, the best choices are given by 8 for the number of bats, 8 for the intensity, and 30 for the frequency, so the treatment parameters are as follows:

The number of iterations is in the interval of [10,100].

The number of bats is fixed at 8.

Loudness 8, Frequency 30.

We experienced the proposed approach on five images through diverse resolutions. **Table 6** illustrates certain quality measurement liable on the resolutions.


#### **Table 4.** *Testing the values of loudness.*


## *Optimization of Fractal Image Compression DOI: http://dx.doi.org/10.5772/intechopen.93051*

#### **Table 5.**

As we can see from the previous tables, the best choices are given by 8 for the number of bats, 8 for the intensity, and 30 for the frequency, so the treatment

**Decompression time**

 0.514 0.713 1.306 29.984 15.348 0.563 0.784 1.299 30.452 15.037 0.562 0.779 1.298 31.228 13.887 0.512 0.715 1.306 30.669 15.603 0.518 0.709 1.320 30.389 16.118 0.520 0.702 1.321 29.856 14.710

We experienced the proposed approach on five images through diverse resolutions. **Table 6** illustrates certain quality measurement liable on the resolutions.

> **Decompression time**

 0.452 0.729 1.372 31.216 9.417 0.458 0.721 1.376 33.022 7.807 0.469 0.702 1.355 30.220 9.375 0.438 0.727 1.359 30.119 9.027 0.460 0.723 1.348 28.971 9.130 0.442 0.727 1.279 34.284 5.600 0.455 0.736 1.220 30.813 6.962 0.468 0.757 1.205 33.859 5.012 0.472 0.755 1.187 33.548 4.362

 0.505 0.716 1.311 30.071 14.929 0.537 0.726 1.324 29.230 16.853 0.586 0.751 1.299 30.536 14.382 0.519 0.713 1.244 30.812 13.766 0.516 0.715 1.223 31.290 12.190 0.503 0.756 1.228 31.032 11.917 0.495 0.740 1.204 32.213 9.056 0.492 0.761 1.194 31.873 8.372 0.488 0.737 1.192 32.050 9.695

Cameraman 2 0.453 0.720 1.267 33.788 6.531

Lena 2 0.530 0.735 1.248 31.781 14.848

**Compression ratio**

**Compression ratio**

**PSNR MSE**

**PSNR MSE**

The number of iterations is in the interval of [10,100].

**Compression time**

**time**

parameters are as follows:

*Testing the number of bats.*

**Table 3.**

**Images Number of**

*Fractal Analysis - Selected Examples*

**bats**

**Table 4.**

**12**

*Testing the values of loudness.*

The number of bats is fixed at 8. Loudness 8, Frequency 30.

**Image Loudness Compression**

*Testing different values of frequency.*


#### **Table 6.** *Testing the image resolutions.*

**Figure 3** shows the image of blonde women before and after proposed compression.

In **Figure 4**, we show a cameraman image before and after proposed compression,

**Figures 5** and **6** describe separately Lena and living room images before and after applying the proposed compression.

The table shows that our approach is significantly sensitive to changing resolutions. It is also clear that the quality of the images is inversely linked to the resolution (as soon as the resolution increases, the quality of the images degrades)

which is well proven by the MSE and PSNR measurements.

**Figure 7.**

Cameraman 256\*256

*Proposed approach versus other methods.*

**Table 7.**

**15**

**Figure 6.**

*An image of compressed and decompressed Mandrill.*

**Test image Methods PSNR**

Vishvas V. Kalunge et al works [42]

Y. Chakrapani et al.'s works [37]

Vishvas V. Kalunge et al.'s works [42]

**(dB)**

Suman K. Mitra et al works [7] 30.22 / 1.059

Exhaustive search 32.69 8400 1.3 DWSR [44] 25.8212 56.4247 1.56355 PSO-RCQP [43] 27.089 6.453 1.6392

BIA 31.095 732.011 1.678 PSO-RCQP [43] 26.686 268 1.8212

Lena 128\*128 BIA 32.909 33.376 1.486

Lena 256\*256 BIA 33.115 732.345 1.604

Barbara 128\*128 BIA 32.176 21.478 1.312

**Compression time (s)**

/ 67 /

26.22 2370 1.3

/ 66 /

**Compression ratio**

*An image of compressed and decompressed living room.*

*Optimization of Fractal Image Compression DOI: http://dx.doi.org/10.5772/intechopen.93051*

Finally, we conclude our sequence of assessments with mandrill image before and after proposed compression, in **Figure 7**.

As we can observe, the images' quality is very suitable.

And to approve this effect, **Table 6** explores additional quality measure.

**Figure 3.** *An image of Compressed and decompressed blond women.*

**Figure 4.** *An image of compressed and decompressed cameramen.*

**Figure 5.** *An image of compressed and decompressed Lena.*

*Optimization of Fractal Image Compression DOI: http://dx.doi.org/10.5772/intechopen.93051*

**Figure 3** shows the image of blonde women before and after proposed

In **Figure 4**, we show a cameraman image before and after proposed

**Figures 5** and **6** describe separately Lena and living room images before and

Finally, we conclude our sequence of assessments with mandrill image before

And to approve this effect, **Table 6** explores additional quality measure.

compression.

compression,

**Figure 3.**

**Figure 4.**

**Figure 5.**

**14**

*An image of compressed and decompressed Lena.*

after applying the proposed compression.

*Fractal Analysis - Selected Examples*

and after proposed compression, in **Figure 7**.

*An image of Compressed and decompressed blond women.*

*An image of compressed and decompressed cameramen.*

As we can observe, the images' quality is very suitable.

The table shows that our approach is significantly sensitive to changing resolutions. It is also clear that the quality of the images is inversely linked to the resolution (as soon as the resolution increases, the quality of the images degrades) which is well proven by the MSE and PSNR measurements.

**Figure 6.** *An image of compressed and decompressed living room.*

**Figure 7.** *An image of compressed and decompressed Mandrill.*


#### **Table 7.**

*Proposed approach versus other methods.*

We note that our proposed method has a remarkable effect on compression ratio and remains relative to the resolution; the bats then show themselves, when the number of blocks is greater (more resolution) by offering a compression ratio greater than that present in the lower resolutions.

On the other hand, the decompression process does not include any complexity compared to the compression process which gives us a decompression time which remains optimized and similar for almost all resolutions.

Finally, and to be in the set of techniques which try to optimize fractal compression, we will draw up a comparison of our approach with certain existing methods. **Table 7** clearly shows the remarkable difference between our method and the others.

At first glance, our proposed method represents new work which has led to satisfactory results. It proportionally retains the quality offered after compression. Reduced time remains very satisfactory, and the compression rate is better than that offered by most of the methods below.
