Optimization of Fractal Image Compression

*Rafik Menassel*

#### **Abstract**

Fractal encoding is a promising method of image compression. It is built on the basis of the forms found in the image and the generation of repetitive blocks based on mathematical translations. The technique seems to be moved theoretically and practically, but it requires enormous programming time due to the excessive resources required when compressing large volumes of data. On the other hand, metaheuristics represent all of the methods used to solve difficult optimization problems with less consumption of resources. They are marked by their rapid convergence and their lessening in research difficulties. In this chapter, we have tried to apply a new experience around the performance of organic metaheuristics inspired by nature, which are, respectively, the wolf pack algorithm (WPA) and the bat-inspired algorithm (BIA), as bioinspired techniques to optimize the fractal image compression (FIC). Experiments show the enhancement of diverse characteristics (coding time, compression rate (CR), peak signal-to-noise ratio (PSNR), and mean square error (MSE)). In addition, an assessment of the proposed approaches via many other approaches highlights this improvement.

**Keywords:** fractal image compression (FIC), metaheuristics, wolf pack algorithm (WPA), bat-inspired algorithm (BIA), image quality

#### **1. Introduction**

Nowadays, a significant size of information is managed and transmitted, and mainly, images have involved prodigious status, particularly in recognition field. Thus, it is important to decrease the size of the data via compression algorithms which can allow their storage and their transmission while using limited resources. Compression is employed to overcome this problem and keep more files. Mainly multimedia files need more storage space than other types of files. Images represent the largest part of the most used multimedia files in almost all fields. Unlike other types of files, a huge amount of image data requires more resources for storage and transmission on computer networks, and compression is therefore presented as an inevitable tool with the aim of more maneuverability of this data. Today, several compression formats exist while presenting their limits (degradations, size, duration, etc.) on somewhat particular images (text images and background areas).

To overcome this difficulty, scientists are constantly developing new techniques to compress images in order to find a perfectionist compression method that can largely conserve storage space and preserve the quality of the source file.

The compression methods that exist tend to introduce the theory of fractals, which appears to be a strong instrument for boosting image quality and reducing the resources required. Nowadays, the image files intricated in several specific programs are characterized by massive data, pixel correlation, and similarity. Under such conditions, the old compression methods appear to be unsuitable for this mission because of their need for significant encoding time. On the other hand, the recently developed fractal image compression techniques offer better compression qualities [1–3]. These methods are built on the principle that shapes (fractals) can better represent usual scenes than traditional geometric forms. A number of fractal image compression techniques are presented in a lot of works; they include an image coding agreeing to more security and less degradation (Jeng et al. [4], Li [5], and Han [6]). These methods have revealed an important in information, reduced statistical characteristics of chaotic patterns, and weakness in statistical cryptanalysis. In addition, metaheuristics are likewise employed to optimize compression, like genetic algorithms [7], ant colonies [8], and optimization by particle swarms [9]. These methods have ability to create a partition constructed on a region which improves the compression ratio and maintains better the decompressed image quality.

where T is a linear transformation, Rn ! Rn is a vector, and b ∈ Rn is a vector. Practically, the general principle of fractal compression is to try to find the finest matching domain blocks for each range block in order to minimize the distance

metric. The code that follows illustrates this idea well:

• Create a partitioning of Range Blocks R

• Create a partitioning of Domain figures

◦ *For* all figures Sources Make

• *For* all the defined transformations Make

◦ Adjust the average of the pixel colors

◦ Apply the transformation to the Range Blocks

◦ Apply the reduction from the Range Blocks to the Domain Blocks

Bi ¼ v Dð Þ<sup>i</sup> (3)

H Bi ð Þ¼ , Ri max d Bi ð Þ , Ri ,d Ri ð Þ ð Þ , Bi (4)

◦ Calculate the error between the result and the Domain Blocks

where v () is the function of the contraction which aims to modify Di. Thereafter, the nearest block Bi is sought for all Ri blocks by calculating the error between Bi and Ri, and we can use, for example, the Hausdorff distance defined by

◦ *If* the error is minimal for the destination figure *Then*

• *For* all figures Destination Make

• Save the modifications made

• Write the saved values in the output file

This process is realized following the relation:

where d(B, R) = max b ϵ A min r ϵ B ||b-r||.

Or using the Euclidean distance described by the equation:

◦ *End if*

◦ *End For*

• *End For*

• *End For*

Equation 4:

**3**

• Enter the original image

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

In this chapter, we try for the first time to apply natural metaheuristics on fractal compression, by suggesting new methods which associate, both the bat-inspired algorithm (BIA) and the wolf pack algorithm (WPA) with fractal image compression (FIC) to speed up encoding and optimize both file size and image quality. The main objective of using these algorithms is its property of search for global solution and its capacity to generate very satisfactory results quickly and for less means compared to similar techniques. The algorithms also use fewer parameters and without initial approximation of the unidentified parameters. This document is organized as follows; Section 1 presents an introduction in the study context. Next, a summary of the fractal image compression is detailed in Section 2. Section 3 summarizes the natural metaheuristics and presents those used in this work, namely, the WPA and the BIA. In Section 4, we give a review of some related works. After that, we present our proposed methods in Sections 5 and 6. Experiments are explained in Section 7. Finally, the conclusion appears in Section 8.

#### **2. Fractal encoding**

Fractal compression is a new method of irreversible image compression [10]. It was adapted by *Hutchinson* [11] and *Barnsley and Demko* [12]. It searches for selfsimilarities among the diverse image blocks [13] and only keeps the parameters of the contractual transformation in place of the pixels of the image. Like this, we can build an estimate as close as possible to the source image by detecting the redundancy of forms at several scales and try to eliminate these redundancies in the original image so that the result is precise enough to be accepted.

The FIC is founded on an iterated function system *f*, a limited group of contractions defined on a metrical space Rn by the relation:

$$\mathbf{f}\_{\mathbf{i}} : \mathbf{R}\_{\mathbf{n}} \to \mathbf{R}\_{\mathbf{n}}; \mathbf{i} < \mathbf{N} \tag{1}$$

This contraction can be in several shapes depending on technical constraints. It can be done several points of the original image and carry them nearer to the compressed one. This reflection is named "affine transformation"; then, each subblock of the original image will be submitted either a rotation at an angle, a scale, or a translation (transformed using eight isometries) according to Equation 2:

$$\mathbf{w}(\mathbf{x}) = \mathbf{T}(\mathbf{x}) + \mathbf{b} \tag{2}$$

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

where T is a linear transformation, Rn ! Rn is a vector, and b ∈ Rn is a vector. Practically, the general principle of fractal compression is to try to find the finest matching domain blocks for each range block in order to minimize the distance metric. The code that follows illustrates this idea well:

• Enter the original image

the resources required. Nowadays, the image files intricated in several specific programs are characterized by massive data, pixel correlation, and similarity. Under such conditions, the old compression methods appear to be unsuitable for this mission because of their need for significant encoding time. On the other hand, the recently developed fractal image compression techniques offer better compression qualities [1–3]. These methods are built on the principle that shapes (fractals) can better represent usual scenes than traditional geometric forms. A number of fractal image compression techniques are presented in a lot of works; they include an image coding agreeing to more security and less degradation (Jeng et al. [4], Li [5], and Han [6]). These methods have revealed an important in information, reduced statistical characteristics of chaotic patterns, and weakness in statistical cryptanalysis. In addition, metaheuristics are likewise employed to optimize compression, like genetic algorithms [7], ant colonies [8], and optimization by particle swarms [9]. These methods have ability to create a partition constructed on a region which improves the com-

pression ratio and maintains better the decompressed image quality.

**2. Fractal encoding**

*Fractal Analysis - Selected Examples*

**2**

In this chapter, we try for the first time to apply natural metaheuristics on fractal compression, by suggesting new methods which associate, both the bat-inspired algorithm (BIA) and the wolf pack algorithm (WPA) with fractal image compression (FIC) to speed up encoding and optimize both file size and image quality. The main objective of using these algorithms is its property of search for global solution and its capacity to generate very satisfactory results quickly and for less means compared to similar techniques. The algorithms also use fewer parameters and without initial approximation of the unidentified parameters. This document is organized as follows; Section 1 presents an introduction in the study context. Next, a summary of the fractal image compression is detailed in Section 2. Section 3 summarizes the natural metaheuristics and presents those used in this work, namely, the WPA and the BIA. In Section 4, we give a review of some related works. After that, we present our proposed methods in Sections 5 and 6. Experiments are explained in Section 7. Finally, the conclusion appears in Section 8.

Fractal compression is a new method of irreversible image compression [10]. It was adapted by *Hutchinson* [11] and *Barnsley and Demko* [12]. It searches for selfsimilarities among the diverse image blocks [13] and only keeps the parameters of the contractual transformation in place of the pixels of the image. Like this, we can build an estimate as close as possible to the source image by detecting the redundancy of forms at several scales and try to eliminate these redundancies in the

The FIC is founded on an iterated function system *f*, a limited group of contrac-

This contraction can be in several shapes depending on technical constraints. It can be done several points of the original image and carry them nearer to the compressed one. This reflection is named "affine transformation"; then, each subblock of the original image will be submitted either a rotation at an angle, a scale, or

a translation (transformed using eight isometries) according to Equation 2:

fi : Rn ! Rn; i< N (1)

w xð Þ¼ T xð Þþ b (2)

original image so that the result is precise enough to be accepted.

tions defined on a metrical space Rn by the relation:

	- *For* all figures Sources Make
	- Apply the transformation to the Range Blocks
	- Adjust the average of the pixel colors
	- Apply the reduction from the Range Blocks to the Domain Blocks
	- Calculate the error between the result and the Domain Blocks
	- *If* the error is minimal for the destination figure *Then*

◦ *End if*

	- *End For*

This process is realized following the relation:

$$\mathbf{B}\_{\mathbf{i}} = \mathbf{v}(\mathbf{D}\_{\mathbf{i}}) \tag{3}$$

where v () is the function of the contraction which aims to modify Di. Thereafter, the nearest block Bi is sought for all Ri blocks by calculating the error between Bi and Ri, and we can use, for example, the Hausdorff distance defined by Equation 4:

$$\mathbf{H}(\mathbf{B}\_{\mathrm{i}}, \mathbf{R}\_{\mathrm{i}}) = \max\left(\mathbf{d}(\mathbf{B}\_{\mathrm{i}}, \mathbf{R}\_{\mathrm{i}}), \mathbf{d}(\mathbf{R}\_{\mathrm{i}}, \mathbf{B}\_{\mathrm{i}})\right) \tag{4}$$

where d(B, R) = max b ϵ A min r ϵ B ||b-r||. Or using the Euclidean distance described by the equation:

$$\mathbf{d}^2(\mathbf{R}, \mathbf{B}) = \sum^\mathbf{n} \left(\mathbf{r}\_\mathbf{i}, \mathbf{b}\_\mathbf{i}\right)^2 \tag{5}$$

solution cannot be certain if, in the investigation space, there is an intersection between the local and global solution [27]. Natural heuristics represent a large family of heuristics which are inspired from communal conduct of animals existing in societies like assemblages of birds, ant colonies, or grouping of fish. They are founded on the principle of populations of entities who cooperate and develop rendering to reciprocal precepts. These techniques allow the invention of procedures which can resolve hard problems by dividing control. These approaches form a famous prototype which is effectively employed as a prodigious tool for resolving difficult problems [28] with less resource consumption. Several researches [29, 30] illustrate that these systems have an effective potential to manage various situations and could be adapted to bring solutions to diversified optimization problems.

The wolf pack algorithm (WPA) [31] belongs to the family of bioinspired techniques which can be used to estimate resolutions for numerous optimization problems. WPA is a metaheuristic built on the population invoked by the social hunting behavior of wolves. It basically involves hunting wolves, tracking down prey, and capturing it under the orders of a leader wolf. The wolf pack includes the strongest and most intelligent wolf chef. He is responsible for controlling the pack. Its decisions are always based on the surrounding environment: prey, pack wolves, and other hunters. The pack is divided into two families of wolves: scoot and ferocious. The scoot wolves move autonomously in the milieu and adjust its way according to the concentration of the odor of the prey. When a prey is found, scoot wolves cry and transmit info by sound to the leading wolf who guesses the distance to reach this prey; it calls the furious wolves and quickly displaces towards the cry. The prey is then caught and is shared conferring to the nature of each wolf: from the sturdiest to the feeblest. Subsequently, feeble wolves could die from absence of nutrition. In this manner the pack ensures a certain dynamic and robustness at all times.

Initially, wolves are distributed chaotically in the environment.

ð Þ <sup>t</sup>þ<sup>1</sup> <sup>¼</sup> xi

choice of the following location is updated by rendering the following equation:

<sup>t</sup> <sup>þ</sup> <sup>λ</sup> <sup>∣</sup>xg

where *λ* represents a vector randomly distributed in the interval [�1,1] and *xg* designates the location of the chief wolf. After a static sum of repetitions, which corresponds to a research stage, the wolf of the finest result gets converted to a leader one; feeble wolves (bad solutions) will be wiped out and substituted with a

The bat-inspired algorithm (BIA) [32] belongs to the family of metaheuristics inspired by nature, introduced by Yang and founded on the echolocation comportment of bats. Bats have a system identical to radar except that radars use electromagnetic waves while bats use ultrasonic waves (of frequency inaudible to

humans). Bats move and hunt with high-performance sonar. By another way, bats are distinguished by an extraordinary steering mechanism allowing them to

<sup>t</sup> � xi

At any instant t, the wolf i passes from the location xt

xi

novel group of wolves in an arbitrary manner.

**3.2 The bat-inspired algorithm**

**5**

, any wolf *i* denotes an elementary solution to the

<sup>i</sup> to the location xt+1

<sup>t</sup> ∣ (8)

i. The

**3.1 The wolf pack algorithm (WPA)**

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

WPA is performed as follows: In a search environment *ℝ<sup>n</sup>*

problem, at a location xi.

where n represents the pixel's number in Ri and Bi blocks. d should be as minimum as possible for blocks that look alike.

Fractal decompression consists of the reconstruction of Ri from the blocks Bi which appear identical the most by practicing the contraction used in compression.

In recent years, several studies have concentrated on the development of accelerated decryption procedures [14–16] with the aim of preserving image quality. Their principle is to choose a random image as the original one and execute an affine transformation like defined in Equations (6) and (7), founded on the fractal ciphers obtained by itself. This act is repeated recursively till the reconstructed image were satisfactory:

$$\mathbf{R}\_{\mathrm{i}} = \mathbf{S}\_{\mathrm{i}} \mathbf{D} + \mathbf{O}\_{\mathrm{i}} \mathbf{I} \tag{6}$$

$$\mathbf{S} = \mathbf{U} \,\, \mathbf{R}\_i \tag{7}$$

where I is a contractive or isometric spatial transformation, D is a domain block, R is a range block, and *S* is the reconstructed image.

In fact, FIC is becoming among the most promising methods for image compression for its significant compression ratio (CR) and preservation of quality. Its beginnings date from the 1990s when Jacquin [17, 18] introduced the first method of image compression; its principle is partitioning the image into two tiling blocks: the range and domain blocks.

The domain blocks are double the size of the range blocks and overlap such that a new domain block starts at each pixel. The main idea of this compression is to find the nearest domain block in concordance with each range block, to determine the right contractual transformation, and to store all these parameters. This principle was exciting; however it remained limited to local applications because it consumes a lot of CPU time. Since then, researchers have constantly presented new techniques to reduce the compression time; Thomas and Deravi [19] link range blocks and brand them more adaptive with image content by using the region-growing method. Cardinal [20] presented an alike principle; it is founded on a geometrical partition of the grayscale image block feature space. The experimental evaluations with earlier published methods illustrate an important enhancement in encoding time with practically better quality. *He et al.* [21] have used the normalized block with the aim to evade the extreme search in corresponding block. Chong and Pi [22] proposed a new adaptive search method to decrease the calculation complexity of fractal encoding to discard a big number of unqualified domain blocks so as to speed up FIC.

Other studies have been presented on new aspects to improve the way of research like the encoding via the Fourier transform [23], special image features [24], and discrete cosine transform inner product [25]. The majority of existing methods rely on a corresponding error threshold to limit the search. Lately, Lin and Wu [26] have defined another way of search built on image block edge property, which proves suitable results. Furthermore, many research articles have been published over the past decade; they increased the quality of the compressed image through the use of metaheuristics without resorting to more resources in the coding process.

#### **3. Natural heuristics**

Heuristics refer to the set of techniques that can solve several problems by maximizing gains and decreasing the resource's consumption; however, the optimal *Optimization of Fractal Image Compression DOI: http://dx.doi.org/10.5772/intechopen.93051*

d2

minimum as possible for blocks that look alike.

*Fractal Analysis - Selected Examples*

reconstructed image were satisfactory:

the range and domain blocks.

**3. Natural heuristics**

**4**

R is a range block, and *S* is the reconstructed image.

ð Þ¼ R, B <sup>X</sup><sup>n</sup>

where n represents the pixel's number in Ri and Bi blocks. d should be as

Fractal decompression consists of the reconstruction of Ri from the blocks Bi which appear identical the most by practicing the contraction used in compression. In recent years, several studies have concentrated on the development of accelerated decryption procedures [14–16] with the aim of preserving image quality. Their principle is to choose a random image as the original one and execute an affine transformation like defined in Equations (6) and (7), founded on the fractal ciphers obtained by itself. This act is repeated recursively till the

where I is a contractive or isometric spatial transformation, D is a domain block,

The domain blocks are double the size of the range blocks and overlap such that a new domain block starts at each pixel. The main idea of this compression is to find the nearest domain block in concordance with each range block, to determine the right contractual transformation, and to store all these parameters. This principle was exciting; however it remained limited to local applications because it consumes a lot of CPU time. Since then, researchers have constantly presented new techniques to reduce the compression time; Thomas and Deravi [19] link range blocks and brand them more adaptive with image content by using the region-growing method. Cardinal [20] presented an alike principle; it is founded on a geometrical partition of the grayscale image block feature space. The experimental evaluations with earlier published methods illustrate an important enhancement in encoding time with practically better quality. *He et al.* [21] have used the normalized block with the aim to evade the extreme search in corresponding block. Chong and Pi [22] proposed a new adaptive search method to decrease the calculation complexity of fractal encoding to

discard a big number of unqualified domain blocks so as to speed up FIC.

metaheuristics without resorting to more resources in the coding process.

Heuristics refer to the set of techniques that can solve several problems by maximizing gains and decreasing the resource's consumption; however, the optimal

Other studies have been presented on new aspects to improve the way of research like the encoding via the Fourier transform [23], special image features [24], and discrete cosine transform inner product [25]. The majority of existing methods rely on a corresponding error threshold to limit the search. Lately, Lin and Wu [26] have defined another way of search built on image block edge property, which proves suitable results. Furthermore, many research articles have been published over the past decade; they increased the quality of the compressed image through the use of

In fact, FIC is becoming among the most promising methods for image compression for its significant compression ratio (CR) and preservation of quality. Its beginnings date from the 1990s when Jacquin [17, 18] introduced the first method of image compression; its principle is partitioning the image into two tiling blocks:

ri ð Þ , bi

<sup>2</sup> (5)

Ri ¼ Si*:*D þ Oi*:*I (6) S ¼ U Ri (7) solution cannot be certain if, in the investigation space, there is an intersection between the local and global solution [27]. Natural heuristics represent a large family of heuristics which are inspired from communal conduct of animals existing in societies like assemblages of birds, ant colonies, or grouping of fish. They are founded on the principle of populations of entities who cooperate and develop rendering to reciprocal precepts. These techniques allow the invention of procedures which can resolve hard problems by dividing control. These approaches form a famous prototype which is effectively employed as a prodigious tool for resolving difficult problems [28] with less resource consumption. Several researches [29, 30] illustrate that these systems have an effective potential to manage various situations and could be adapted to bring solutions to diversified optimization problems.

#### **3.1 The wolf pack algorithm (WPA)**

The wolf pack algorithm (WPA) [31] belongs to the family of bioinspired techniques which can be used to estimate resolutions for numerous optimization problems. WPA is a metaheuristic built on the population invoked by the social hunting behavior of wolves. It basically involves hunting wolves, tracking down prey, and capturing it under the orders of a leader wolf. The wolf pack includes the strongest and most intelligent wolf chef. He is responsible for controlling the pack. Its decisions are always based on the surrounding environment: prey, pack wolves, and other hunters. The pack is divided into two families of wolves: scoot and ferocious.

The scoot wolves move autonomously in the milieu and adjust its way according to the concentration of the odor of the prey. When a prey is found, scoot wolves cry and transmit info by sound to the leading wolf who guesses the distance to reach this prey; it calls the furious wolves and quickly displaces towards the cry. The prey is then caught and is shared conferring to the nature of each wolf: from the sturdiest to the feeblest. Subsequently, feeble wolves could die from absence of nutrition. In this manner the pack ensures a certain dynamic and robustness at all times.

WPA is performed as follows:

In a search environment *ℝ<sup>n</sup>* , any wolf *i* denotes an elementary solution to the problem, at a location xi.

Initially, wolves are distributed chaotically in the environment.

At any instant t, the wolf i passes from the location xt <sup>i</sup> to the location xt+1 i. The choice of the following location is updated by rendering the following equation:

$$\mathbf{x\_i^{(t+1)} = x\_i^t + \lambda \left| x\_{\mathfrak{g}}^t - x\_i^t \right|}\tag{8}$$

where *λ* represents a vector randomly distributed in the interval [�1,1] and *xg* designates the location of the chief wolf. After a static sum of repetitions, which corresponds to a research stage, the wolf of the finest result gets converted to a leader one; feeble wolves (bad solutions) will be wiped out and substituted with a novel group of wolves in an arbitrary manner.

#### **3.2 The bat-inspired algorithm**

The bat-inspired algorithm (BIA) [32] belongs to the family of metaheuristics inspired by nature, introduced by Yang and founded on the echolocation comportment of bats. Bats have a system identical to radar except that radars use electromagnetic waves while bats use ultrasonic waves (of frequency inaudible to humans). Bats move and hunt with high-performance sonar. By another way, bats are distinguished by an extraordinary steering mechanism allowing them to

differentiate between an obstacle and a prey, which allows them to hunt even all. The impulses produced by bats can be linked almost to the hunting plans of bats. Often, the pulses are between 25 and 150 kHz at a static frequency; they only persist for 8–10 ms. Bats generate between 10 and 20 ultrasonic sound eruptions every second, each of them stays between 5 and 20 ms. However, when bats seek their prey and feel so close, they can increase the rate of emission of sound eruptions up to 200/s. This proves the extraordinary ability of bats to process signals. Assuming that the speed of sound in air is v = 340 m/s, the wavelength λ of the ultrasonic sound therefore manifests with a continuous frequency *f*:

$$
\lambda = \upsilon/f \tag{9}
$$

In the work of Xing-yuan, Fan-ping, and Shu-guo [36], a spatial correlation hybrid genetic algorithm that uses the features of the fractal and divided iterative function system is proposed. It consists of two stages. The first uses spatial correlation in the images for the range and the domain blocks in order to exploit the local optima. The second one is based on a genetic-simulated annealing algorithm (SAGA) to find the global optima if the local optima is not satisfied. In order to escape early convergence, the algorithm approves that the dyadic mutation operator

In 2010, Chakrapani et al. have enhanced the fractal image compression using particle swarm optimization (PSO) technique [37]. PSO is used to speed up the search of the nearest finest match block for a definite block to be encoded. This method illustrates that the recovered image quality can be conserved when in

In 2016, Shaimaa S. Al-Bundi et al. [38] use an upgraded genetic algorithm to enhance the exploration space in the target image by good estimation to the global

In 2017, Al-Saidi N.M.G et al. [39] optimize the fractal image compression by introducing the harmony search algorithm. This strategy searches for the best solution through singing a song; this proposed technique offers splendid performances in terms of image quality, reduced computation time, and storage space

In 2018, we [40] used the wolf pack algorithm to improve the FIC; the idea is to take the entire image for the search space where this space is divided into blocks; scooters wolves roam the environment to find other smaller and similar blocks. They examine the entire space and select the blocks with the best physical shape. By this method, the encoding time was considerably reduced, and we also obtained a

In 2019, we have [41] chosen to improve the FIC by using the bat-inspired algorithm. Our tow proposed methods are detailed and well explained in Sections 5

We assume an image of m x n pixels as exploration space, represented by an array P where each pixel is considered as a cell and on a byte (gray pixel). The

• Divide the entire image into tiny nonoverlapping ri blocks of size s s (with s < < m). More simply, we will proceed with blocks of square size of b x b; this

• For all the blocks ri, the scooting wolves roam the space in order to find a di of size 2b 2b similar with ri while respecting the parameters mentioned above. A fitness value f (di) will be assigned for each block di according to Eq. (6). The

• After the hunting wolves have inspected the entire space and for all ri blocks, di blocks with the best physical form are selected. It will be mapped according to

If no improvement is made to the wolf chef solution, the process will be stopped

partition called range block will be represented by RN = {r1, r2, … , rN}.

**5. Wolf pack algorithm to optimize fractal image compression**

resulting image C of m/2 n/2 pixels is reached by following the steps:

takes place in place of the traditional operator.

comparison with the full-search FIC.

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

optimum in an only execution.

when compared to other methods.

block di is taken for prey.

after a fixed number of iterations.

Eqs. (4) and (5).

**7**

better compression rate.

and 6, respectively.

The wavelengths vary between 2 and 14 mm and are equivalent to the size of the bat's prey, for a representative frequency between 25 and 150 kHz. The pulses produced by bats can spread an imposing sound intensity of 110 dB, but quite favorably, these pulses remain in the ultrasonic domain. The intensity of the pulse can take different stages, such as very strong when bats are chasing and weak at a quiet sound when they mark their prey. These short pulsations usually have a wandering range of a few meters which depends on the frequency.

In reality, bats combine all of their senses to effectively detect prey and navigate more easily. Here, we are only interested in echolocation and the behaviors that accompany it. To create new optimization techniques, the echolocation of bats can be transformed into an optimized objective function.

In a search space Ri, the bats fly randomly using the speed Vi in location (solution) Xi using velocity Vi. They produce pulses at a static wavelength λ with a variable frequency f and an intensity A (differs from a big positive A0 to a smallest constant value Amin) to hunt for prey. When the bats choice the finest results, they choose a local result from the best selected ones.

#### **4. Introducing bioinspired approaches in the FIC**

In 2005, Dervis Karaboga proposed a new iterative optimization method based on artificial bee colonies (ABC). This technique is based on three different classes of bees, (a) bee used, (b) spectator bee, and (c) scout bee. The spectator bees waiting in the store obtain data concerning the sources of nectar revealed earlier from the employees. Then they choose a usable nutrition source built on the received information. Scout bees arbitrarily search for nutriment in the area for [33].

In 2006, Cristian Martinez presented an enhanced image compression using the ant colony technique. The basic idea is that ants always seek and find the shortest path from nest to food source using the pheromone. For fractal compression, the pheromone is positioned on the range block i and the domain block j. The pheromone matrix is rectangular (not symmetrical) where the lines designate range blocks (image blocks) and the columns indicate domain blocks (blocks to transform). Then, the ants build routes by choosing a block of domain j for each block of range i. the solution will be found on the basis of updating the pheromone and heuristic information [34]. The result proposes similar image quality to that obtained with a deterministic way while minimizing the calculation time by 34%.

In 2009, many of studies were focalized on FIC: Chakrapani and Soundara Rajan [35] have created a new fractal image compression founded on a genetic algorithm in the intention of optimizing the encoding time for an acceptable image quality. The results give improved performance over exhaustive search.

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

differentiate between an obstacle and a prey, which allows them to hunt even all. The impulses produced by bats can be linked almost to the hunting plans of bats. Often, the pulses are between 25 and 150 kHz at a static frequency; they only persist for 8–10 ms. Bats generate between 10 and 20 ultrasonic sound eruptions every second, each of them stays between 5 and 20 ms. However, when bats seek their prey and feel so close, they can increase the rate of emission of sound eruptions up to 200/s. This proves the extraordinary ability of bats to process signals. Assuming that the speed of sound in air is v = 340 m/s, the wavelength λ of the ultrasonic

The wavelengths vary between 2 and 14 mm and are equivalent to the size of the

In reality, bats combine all of their senses to effectively detect prey and navigate more easily. Here, we are only interested in echolocation and the behaviors that accompany it. To create new optimization techniques, the echolocation of bats can

In 2005, Dervis Karaboga proposed a new iterative optimization method based on artificial bee colonies (ABC). This technique is based on three different classes of bees, (a) bee used, (b) spectator bee, and (c) scout bee. The spectator bees waiting in the store obtain data concerning the sources of nectar revealed earlier from the employees. Then they choose a usable nutrition source built on the received infor-

In 2006, Cristian Martinez presented an enhanced image compression using the ant colony technique. The basic idea is that ants always seek and find the shortest path from nest to food source using the pheromone. For fractal compression, the pheromone is positioned on the range block i and the domain block j. The pheromone matrix is rectangular (not symmetrical) where the lines designate range blocks (image blocks) and the columns indicate domain blocks (blocks to transform). Then, the ants build routes by choosing a block of domain j for each block of range i. the solution will be found on the basis of updating the pheromone and heuristic information [34]. The result proposes similar image quality to that obtained with a deterministic way while minimizing the

In 2009, many of studies were focalized on FIC: Chakrapani and Soundara Rajan [35] have created a new fractal image compression founded on a genetic algorithm in the intention of optimizing the encoding time for an acceptable image quality.

mation. Scout bees arbitrarily search for nutriment in the area for [33].

The results give improved performance over exhaustive search.

bat's prey, for a representative frequency between 25 and 150 kHz. The pulses produced by bats can spread an imposing sound intensity of 110 dB, but quite favorably, these pulses remain in the ultrasonic domain. The intensity of the pulse can take different stages, such as very strong when bats are chasing and weak at a quiet sound when they mark their prey. These short pulsations usually have a

In a search space Ri, the bats fly randomly using the speed Vi in location (solution) Xi using velocity Vi. They produce pulses at a static wavelength λ with a variable frequency f and an intensity A (differs from a big positive A0 to a smallest constant value Amin) to hunt for prey. When the bats choice the finest results, they

wandering range of a few meters which depends on the frequency.

be transformed into an optimized objective function.

choose a local result from the best selected ones.

calculation time by 34%.

**6**

**4. Introducing bioinspired approaches in the FIC**

*λ* ¼ *v=f* (9)

sound therefore manifests with a continuous frequency *f*:

*Fractal Analysis - Selected Examples*

In the work of Xing-yuan, Fan-ping, and Shu-guo [36], a spatial correlation hybrid genetic algorithm that uses the features of the fractal and divided iterative function system is proposed. It consists of two stages. The first uses spatial correlation in the images for the range and the domain blocks in order to exploit the local optima. The second one is based on a genetic-simulated annealing algorithm (SAGA) to find the global optima if the local optima is not satisfied. In order to escape early convergence, the algorithm approves that the dyadic mutation operator takes place in place of the traditional operator.

In 2010, Chakrapani et al. have enhanced the fractal image compression using particle swarm optimization (PSO) technique [37]. PSO is used to speed up the search of the nearest finest match block for a definite block to be encoded. This method illustrates that the recovered image quality can be conserved when in comparison with the full-search FIC.

In 2016, Shaimaa S. Al-Bundi et al. [38] use an upgraded genetic algorithm to enhance the exploration space in the target image by good estimation to the global optimum in an only execution.

In 2017, Al-Saidi N.M.G et al. [39] optimize the fractal image compression by introducing the harmony search algorithm. This strategy searches for the best solution through singing a song; this proposed technique offers splendid performances in terms of image quality, reduced computation time, and storage space when compared to other methods.

In 2018, we [40] used the wolf pack algorithm to improve the FIC; the idea is to take the entire image for the search space where this space is divided into blocks; scooters wolves roam the environment to find other smaller and similar blocks. They examine the entire space and select the blocks with the best physical shape. By this method, the encoding time was considerably reduced, and we also obtained a better compression rate.

In 2019, we have [41] chosen to improve the FIC by using the bat-inspired algorithm. Our tow proposed methods are detailed and well explained in Sections 5 and 6, respectively.
