private static bool recompressImage(PdfImage image) { if (image.ComponentCount == 1 && image.BitsPerComponent == 1 && image.Compression == PdfImageCompression.Group3Fax) { image.RecompressWithGroup4Fax(); return(true); } if (image.BitsPerComponent == 8 && image.ComponentCount >= 3 && image.Compression != PdfImageCompression.Jpeg && image.Compression != PdfImageCompression.Jpeg2000) { if (image.Width < 64 && image.Height < 64) { // JPEG better preserves detail on smaller images image.RecompressWithJpeg(); } else { // you can try larger compressio ratio for bigger images image.RecompressWithJpeg2000(10); } return(true); } return(false); }