# Pre and Postprocessing for JPEG to Handle Large Monochrome Images
## 1 Introduction  
In recent years, image compression has been considered as an attractive research field. Frequently, data are represented using large size images such as wallpaper and high quality media, which in turn need to be stored and transmitted without requiring large storage space or increased transmission rate of the communication channel [1]. In general, image compression with better quality reconstructed images is the main goal of any compression technique. This involves removing the redundancy and minimizing the loss in the image [2]. Image compression algorithms can be categorized into either lossless or lossy [1; 3]. While lossless compression methods conserve the original image to be recovered completely after the decompression process [4], lossy compression uses the inherent redundancies found in an image, such as inter-pixel redundancy, psycho-visual redundancy, or coding redundancy, to decrease the data amount needed to represent the image [5; 6; 7]. Accordingly, lossless methods produce low compression ratio and error-free images; meanwhile, lossy methods produce high compression ratio with additional error (PSNR) [8]. Image compression is implemented into spatial domain and frequency domain. In spatial domain, image compression techniques aim to reduce the number of pixels representing the image without influencing the quality of the resulted image [9; 10; 11]. In frequency domain, Discrete Cosine Transform (DCT) [12; 13], Discrete Fourier transform, or Discrete Wavelet Transform [5; 14; 15] are used to represent the energy of the image into a few number of coefficients. JPEG is the most widely used method for lossy compression of digital photographs. Other sophisticated popular standards are JPEG2000, WebP, and Better Portable Graphics (BPG) [16]. In the JPEG process, an image is divided into several \(8\times 8\) blocks. Then, two-dimensional Discrete Cosine Transform (2D DCT) is applied for encoding each block. After performing DCT, most energy is concentrated in the low frequency region, which is very beneficial for compression as the human eye is sensitive to it. Subsequently, quantization is carried out for each block, where all 64 coefficients are quantized according to the desired image quality. Certain lossless compression operations are performed on the quantized data, consisting of a zig-zag scan of coefficients and entropy coding. The results of this process are rounded to integers. As a result of this step, some of the image information is lost. Finally, the Huffman method is used to encode the reduced coefficients using Huffman codes [17]. Although JPEG is a very widely used standard for image compression, it is still not applicable for many types of images like hyperspectral, radar, and medical images. Most objects are irregularly shaped and are not well approximated by the combination of rectangular blocks. In the block encoding process, a number of undesirable artifacts are introduced in the image, such as blocking artifacts (caused by discontinuities at the block boundaries) and ringing artifacts (caused by oscillations due to the Gibbs phenomenon). These problems become more apparent with increasing compression ratio [17; 18]. Various studies have been carried out to improve and outperform well-known lossy compression methods, especially JPEG [19; 20]. The aim is to make degraded images perceived better visually. This is a fundamental problem in the image processing field and is a subjective issue, as the quality of an image is decided by Human Visual System (HVS). In terms of the decompressed image, these studies aim to achieve better brightness and contrast, good color consistency, reduced noise, and better resolution than well-known lossy image compression methods. One way to improve the compression quality is to denoise the image as a pre-processing step using smoothing filters and median filters [19]. Another method is to reapply JPEG by associating the image database [17; 18; 20]. In [17], shape adaptive image compression algorithms were addressed.