How to disable dithering when saving as an image

Hi,

I want to convert an Excel file (XLSX) into a TIFF image in black and white without dithering applied. This is my SavingOptions

var options = new ImageOrPrintOptions();
options.setImageType(ImageType.TIFF);
options.setTiffCompression(TiffCompression.COMPRESSION_CCITT_3);
options.setTiffColorDepth(ColorDepth.FORMAT_1_BPP);
options.setAllColumnsInOnePagePerSheet(true);

Worksheet sheet = workbook.getWorksheets().get(0);
SheetRender render = new SheetRender(sheet, getOptions(settings));
render.toImage(pageIndex, tiffPage.getAbsolutePath());

The TIFF outputs seemed to have dithering applied as if Apose.Image way is dither(DitheringMethod.FloydSteinbergDithering, 1). What I want is dither(DitheringMethod.ThresholdDithering, 1)

Sample input/output: xls_tiff.zip (4.6 MB)

Desired output:desired.tiff.zip (36.1 KB)

@tmhungtrilogy,

Thanks for the sample code segment, template file, output images.

Well, Aspose.Cells is a spreadsheet management API(s) rather than image manipulation component. Although we do provide some useful and out of the box features like Sheet/Shape to image and Excel to PDF features for the users but a deeper image manipulation is itself a different and complex thing. May be you could use some image manipulation APIs for the task, e.g you may try Aspose.Imaging, etc. I also scanned Aspose.Cells image rendering APIs a bit but I could not find more suitable APIs for disabling dithering or something like your way when saving a worksheet as a TIFF image. We will still check and investigate if we can accomplish the task or provide some means or API as per your needs. I have logged a ticket with an id “CELLSJAVA-43190” for your requirements. We will look into it soon.

Once we have an update on it, we will let you know.

@tmhungtrilogy,

We analyzed your issue further.
Please note, Aspose.Cells dither images to get more acceptable white and black images. I am afraid, disable dithering feature is not supported and may not be supported in near future.