Environment:
- Aspose.Cells Version: 24.8.0
- Platform: .NET 3.0
- Operating System: Windows / Linux
- Conversion Type: Excel → Multi-page TIFF
- Image Type: Color input files
Issues Observed:
-
Color Image Sheets Not Converting Properly:
When the Excel workbook contains colored shapes, logos, graphs, or backgrounds, the TIFF output does not preserve those colors correctly. Some colors appear desaturated, distorted, or partially missing compared to the original workbook.
-
Final TIFF Output Always in Black & White (B/W):
Even when the input Excel file is fully colored, the generated TIFF file is always produced in Black & White.
- The BlackAndWhite = false setting appears to be ignored.
- Only the first page may reflect color partially; other pages are converted only in grayscale.
- If we avoid saving the workbook directly and instead generate multipage TIFF via rendering options, the problem still persists.
- The data looks small on the page, making it messy and unclear on the conversion.
Expected Behavior:
- All pages in the Excel workbook should convert to TIFF in full color when BlackAndWhite = false.
- Color images, shapes, logos, and cell backgrounds should render exactly as in the original Excel sheet.
- Multi-page TIFF should preserve color consistently on all pages.
Actual Behavior:
Conversion example records:
Excel-To-TIFF.zip (557.5 KB)
- TIFF output is always Black & White, regardless of settings.
- Some colored sheets lose color information, especially in multi-page TIFF output.
- The first page may show partial color, but subsequent pages do not.
Attachments:
- Sample Excel file.
- Actual TIFF output.
Sample code:
var renderOptions= new ImageOrPrintOptions
{
ImageType = Aspose.Cells.Drawing.ImageType.Tiff,
OnePagePerSheet = false,
PrintingPage = PrintingPageType.Default
};
renderOptions.TiffCompression = blackAndWhite ? TiffCompression.CompressionCCITT4 : TiffCompression.CompressionLZW;
var workbookRender = new WorkbookRender(workbook, renderOptions);
@mukeshkanna
Summary
The TIFF output is being generated in black‑and‑white even though the workbook contains colour. This usually means the rendering options are causing the conversion to a monochrome bitmap before the TIFF is written.
Why it happens
- The
ImageOrPrintOptions.BlackAndWhite flag controls whether the renderer creates a 1‑bit (B/W) image. If this flag is true (or inadvertently left at its default for the current environment), colour information is discarded.
- When the flag is true, any compression setting (e.g., LZW, CCITT) will operate on a B/W image, so colour cannot be restored later.
- Multi‑page assembly may use a different code path that defaults to B/W, which can explain why the first page sometimes shows a hint of colour while the remaining pages are grayscale.
What to do next
- Explicitly set the BlackAndWhite flag to false before rendering:
var renderOptions = new ImageOrPrintOptions
{
ImageType = ImageType.Tiff,
OnePagePerSheet = false, // multi‑page TIFF
BlackAndWhite = false, // ensure colour rendering
TiffCompression = TiffCompression.CompressionLZW // or another supported compression
};
var workbookRender = new WorkbookRender(workbook, renderOptions);
workbookRender.Save("output.tiff");
- Verify DPI and scaling if the pages look small. Increase
HorizontalResolution and VerticalResolution (e.g., 200‑300 dpi) to get a larger, clearer image.
- Check other print‑related settings on the workbook (such as
FitToPagesWide/FitToPagesTall) that might shrink the rendered content.
- Test with a minimal workbook containing simple coloured shapes or cell backgrounds to confirm that colour is retained when
BlackAndWhite = false.
- If the issue persists, gather the following details before contacting Aspose support:
- Exact version of Aspose.Cells being used.
- Full snippet of the rendering code and any workbook
PrintOptions values.
- DPI settings and compression type.
- A small reproducible Excel file that demonstrates the problem.
Providing this information will help the support team investigate any potential bug in the specific version you are using.
Note: The evidence does not contain definitive information about default values for BlackAndWhite or other properties, so the above steps focus on explicitly configuring the options you control.
I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.
@mukeshkanna,
I tested your scenario/case using your template Excel file with latest version/fix: NuGet Gallery | Aspose.Cells 25.11.0 a bit to convert to TIFF, the output TIFF is OK. Please try Aspose.Cells for .NET v25.11 and in case you still find any issue, kindly do provide your output TIFFs and complete sample (runnable) code. We will check your issue soon.