# Pre and Postprocessing for JPEG to Handle Large Monochrome Images
## 1 Introduction
Here, the Shape-Adaptive Discrete Cosine Transform (SA-DCT) is used for transforming and encoding each block. The paper generalizes the JPEG algorithm and divides an image into trapezoid and triangular blocks according to the shapes of objects to achieve higher compression ratio. As it had replaced the use of \(8\times 8\) blocks adaptively with triangular, trapezoid, and polygonal blocks, the JPEG algorithm is made more flexible. The boundaries of these polygonal blocks matched the boundaries of objects and allowed the resulting object-orient image compression to achieve higher compression ratio [17]. In [18], a new method is proposed for post-processing of JPEG-encoded images in order to reduce coding artifacts and enhance visual quality. This method simply re-applies JPEG to the shifted versions of the already compressed image. However, the approach does not specifically count the discontinuities in the block boundaries, neither does it make direct use of the smoothness criteria. It uses the JPEG process itself to reduce the compression artifacts of the JPEG encoded image. On the other hand, the work in [15] presents a computationally efficient framework for color image enhancement in the compressed wavelet domain. It proposes a fast image enhancement framework in the compressed wavelet domain, especially for JPEG2000. The proposed approach introduces enhancements in both global and local contrast and brightness as well as preserving color consistency. In this framework, inverse transform is shown to be unneeded for image enhancement since linear scale factors were directly applied to both scaling and wavelet coefficients in the compressed domain, which resulted in high computational efficiency. Furthermore, deep neural networks are effectively used in solving lossy image compression problems since the late 1980s [21]. In these methods, the basic autoencoder structure is used, and a binary representation for an image is introduced by quantizing either the bottleneck layer or the corresponding variables. In [16], a method for lossy image compression based on recurrent, convolutional neural networks is proposed, while, in [7], Fuzzy C-mean clustering for priority mappinghas also been used as an adaptive quantization mask in order to improve encoding efficiency of JPEG method by keeping possession of image data. As a result, the blocking artefacts and encoding bit rates were reduced, while the compression efficiency for acceptable image quality was enhanced. The work in [6] presented a modified JPEG image compression method useful for simulation in industry and biomedical applications by utilizing a region-based variable quantization scheme. It uses three masks that are step, linear, and raised cosine interpolated for controlling the quantization granularity which appear in transitions between regions. Meanwhile, image compression using JPEG algorithm results in an unwanted blocking effect in smooth areas, which is generated due to the coarse quantization of DCT coefficients. [PERSON] proposed a deblocking algorithm for filtering those blocked boundaries by making use of smoothening, detection of blocked edges, and filtering only the difference between the pixels that contain the blocked edge [2]. Finally, [PERSON] et al. improved JPEG compression quality through searching for new quantization tables that have the ability to decrease the FSIM (feature Similarity Index Measure) error and increase CR (Compression Ratio) at certain quality levels [22]. In this paper, a new scheme is implemented to enhance the JPEG compression algorithm to have better compression ratios compared to JPEG in the case of large images. The paper is organized as follows; Section 2 explains the methodology for the proposed method where image compression and decompression algorithms are given in detail, and Section 3 provides the experimental results for implementing the algorithm explained in Section 2. Here, many cases and tests are examined. Finally, Section 4 concludes the work done in this paper.