Image Quality Issue when Converting PowerPoint Presentation to TIFF in C#

@hemalp,
Unfortunately, we cannot propose a solution better.

Hi @andrey.potapov,

Thanks for update, as we are using all aspose module for printing BW TIFF files, here we are getting proper output for word module(here it use Colormode property) but for PPT,PDF and Excel we are having issue and there are some discussion around this point.

So just wondering , would it be not be feasible to provide same solution to other modules for gray scale print concern,
or we can have point like below,
for our client usage they just want to print file in BW with CCIT compression , here for other modules, it just get concern in result with greayscale font because it replace with white colors, so if there any point like instead white we can replace it with black color for grayscale input then also it may work.

Thanks

@hemalp,
If I understand correctly, you are already successfully using a solution to convert Word documents to TIFF images with Aspose.Words for .NET. Could you please share the simplest example for our reference to consider implementing such a feature in Aspose.Slides?

Sample Code:

Aspose.Words.Document doca = new Aspose.Words.Document(@"GENERAL.doc");

Aspose.Words.Saving.ImageSaveOptions options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Tiff);
options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Tiff);
options.UpdateFields = false;
options.Resolution = 300;
options.TiffCompression = Aspose.Words.Saving.TiffCompression.Ccitt4;
**options.ColorMode = Aspose.Words.Saving.ColorMode.Grayscale; **
options.ImageSize = new System.Drawing.Size(2550, 3300);
options.TiffBinarizationMethod = Aspose.Words.Saving.ImageBinarizationMethod.FloydSteinbergDithering;
for (int page = 0; page < doca.PageCount; page++)
{
    options.PageSet = new PageSet(page);
    try
    {
        doca.Save(string.Format("_{0:" + "D6" + "}", page + 1) + ".tif", options);
    }
    catch (Exception ex)
    { }
}

Required Files: Word.zip (943.7 KB)

@hemalp,
Thank you for the code example. I’ve forwarded it to our developers. We will consider implementing such a feature in Aspose.Slides.

@hemalp,
With Aspose.Slides for .NET 23.9, you will be able to achieve your purposes like this:

// Load the presentation
using (Presentation presentation = new Presentation(pathToPresentation))
{
    // Create a TiffOptions object with specified settings
    Aspose.Slides.Export.TiffOptions options = new Aspose.Slides.Export.TiffOptions()
    {
        DpiX = 300,
        DpiY = 300,
        CompressionType = Aspose.Slides.Export.TiffCompressionTypes.CCITT4,
        // `BlackWhiteConversionMode.Dithering` is recommended for your case
        BWConversionMode = Aspose.Slides.Export.BlackWhiteConversionMode.Dithering
    };

    // Iterate through each slide in the presentation
    for (int i = 0; i < presentation.Slides.Count; i++)
    {
        // Generate the file name for the TIFF image
        string fileName = Path.Combine(pathToTiffFiles, $"ppt{i}.tiff");

        // Save the slide as a TIFF image using the specified options
        presentation.Save(fileName, new int[] { i + 1 }, Aspose.Slides.Export.SaveFormat.Tiff, options);
    }
}

Aspose.Slides for .NET 23.9 will be published in the second half of September, you will be notified.

The issues you found earlier (filed as SLIDESNET-43931) have been fixed in Aspose.Slides for .NET 23.10 (ZIP, MSI).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.

@hemalp,
With Aspose.Slides for .NET 23.10, the new TiffOptions.BwConversionMode property allows you to specify the algorithm for converting a color image to a black and white image. This setting is applied only when CompressionType property is set to TiffCompressionTypes.CCITT4 or TiffCompressionTypes.CCITT3.

var tiffOptions = new TiffOptions
{
    CompressionType = TiffCompressionTypes.CCITT4,
    BwConversionMode = BlackWhiteConversionMode.Dithering
};

using var presentation = new Presentation("sample.pptx");
presentation.Save("output.tiff", SaveFormat.Tiff, tiffOptions);