# An Efficient Encoding Algorithm Using Local Path on Huffman Encoding Algorithm for Compression
###### Abstract
Let's call this function \(f(x,y)\). The \(x\) and \(y\) values found as parameters in the function represent plane coordinates. This value is also referred to as amplitude, \(f(x,y)\) gray level, density, or brightness in any coordinate couple [27]. An image needs to be digitized to be processed on a computer. As shown in Figure 1, \(i\) and \(j\) parameters in \(f(i,j)\) are integer values in a digitized image. A digitizer is required to obtain an appropriate digital version of an image in the computer environment. In this context, the most commonly used digitizers are scanners and digital cameras. Images that use only light intensity are called grayscale images. The pixel on the image is a scalar proportional to the brightness. Grayscale images allow 256 color combinations, because the pixels use an 8-bit unsigned integer value that can be set between 0 and 255. An example of a grayscale image is shown in Figure 2.  
Figure 1: Representation of an image in a computer environment. (**a**) Continuous \(f(x,y)\). (**b**) Digital \(f(i,j)\). According to the Young-Helmholtz theory of color vision, color images are represented by the master colors red, green, and blue [28]. The color space is obtained by linear combinations of these three main colors. Each color image scales the color and intensity of the light so that each color pixel represents a vector of color fragments. There are color spaces commonly used in the printing industry such as CMYK (cyan, magenta, yellow, and black), RGB (red, green and blue), and HSV (hue, saturation, and value) [9]. Color images consist of three matrices, each with 8-bit values. These matrices represent the coordinates of each pixel in other color fields. That is, each pixel has a 24-bit sensitivity value, which is defined as 24-bit color. The encoding phase is one of the most important steps in compression algorithms. The most important algorithms used in this field are the Huffman encoding algorithm and the arithmetic coding algorithm. Although the arithmetic coding algorithm has been developed to improve the efficiency of the Huffman encoding algorithm, it has deficiencies in mathematical processing and complexity. Therefore, there is a need for a new encoding algorithm that is more efficient and offers more successful compression results. The aim of this study is to develop an effective encoding algorithm suitable for all compression algorithms. The Huffman encoding algorithm and arithmetic coding algorithm are frequently used coding algorithms in the kernel of compression algorithms. Here, a new encoding algorithm has been developed that uses the advantages of the Huffman encoding algorithm and will eliminate the gaps of the arithmetic coding algorithm. The proposed encoding algorithm uses a modified tree structure from the Huffman encoding algorithm. After modification, a group of process is applied to the image to achieve a higher compression ratio and a lower number of bits per pixel. Since the deficiencies in the coding algorithms are addressed in this new algorithm, it will bridge the gap in the literature. This encoding algorithm will contribute to the literature and will likely be preferred in the compression algorithms to be developed. The remainder of the paper is organized as follows: Section 2 describes the technical background that is used in this work. In Section 3, the proposed encoding algorithm is described with the necessary equations, representations, and step-by-step workflow. The experiment simulation and analysis of the proposed encoding algorithm is detailed in Section 4. Section 5 describes the results and discussion part of this work. In Section 6, the paper is concluded with a general summary of the study.