## 4 Discussion  
The edge-preserving methods we introduced here allowed us to successfully remove compression artifacts and improve the overall image quality. We decided to take into account the color intensity values on the edges instead of simple binarization as in the original method described in [23]. Moreover, we used color stain deconvolution to extract the information about the nuclei boundaries more precisely, which allowed us to improve the image quality more than other non-deep learning methods for most compression quality factors used in the JPEG algorithm. The developed methods were designed to process H&E images but also improved the quality of compressed images from multiple other datasets with various origins (mostly natural images). The results of EPIIC and EPIIC Sobel achieved for images from datasets commonly used to show the efficiency of different compression artifacts removal algorithms and the BreCaHAD dataset are inferior to those for the method based on deep learning. This outcome was rather expected since our goal was to ensure the simplicity of the developed algorithms even at the cost of performance because they are designed to be used to process large WSI images. FBCNN on CPU was almost 100 times slower than EPIIC, while on GPU, it was still more than 5 times slower. However, a comparison of all deep learning-based methods and our methods in terms of computational efficiency on WSI images is needed. The main drawback of compression of WSI images is the reduced efficiency of algorithms used to segment individual cells or important fragments of the tissue. We introduced edge-preserving methods that could efficiently remove blocking artifacts but that should not decrease the performance of cell/tissue segmentation methods. Note that the developed methods are based on classical image processing operations. Unlike deep neural networks, they do not require datasets to train the model. The developed methods improved performance and allowed more accurate detection of nuclear instances. _DICE_ and _AJ1_ have a limitation: predictions that differ by only a few pixels can have significantly different _AJ1_ and _DICE_ results, particularly when two nuclei are adjacent and only one is detected. This can strongly affect the accurate evaluation of segmentation results, especially if the tissue image contains a lot of difficult-to-detect instances. Therefore, using the \(PQ\) measure to assess the segmentation quality allows for a more reliable analysis of the results. Based on \(PQ\), EPIIC and EPIIC Sobel led to better nuclei segmentation results than all other methods. Interestingly, processing the images with FBCNN, which performed best in removing artifacts in most cases, caused a decline in segmentation results tested by two different models. It is worth noting that this particular method takes the \(QF\) parameter value into account when eliminating distortions. The FBCNN method focuses on improving image quality, and the methods we propose are aimed at improving segmentation quality. Using the generated edge maps, the pixels along cell edges undergo less blurring compared to those inside the cells, resulting in better preservation of these regions. The proposed edge-preserving algorithms provided better results than Gaussian blur in terms of both segmentation results and image quality improvement. The Guided filter enabled improved image quality, especially for small \(QF\) values. However, the incorrect predictions seen in some of the segmentation results bring into doubt the validity of applying this method to the removal of blocking artifacts from histopathology images. Both datasets contained compressed images with different values of the \(QF\) parameter, and nuclei determinations were already made on the compressed images, which could have affected the results. To better evaluate the methods mentioned above, testing their performance on datasets labeled before compression would be necessary.