Better quality TIFF conversion

Hello Aspose guys!


We are now converting an image to a tiff file like this:

Public Sub ConvertImageToTiff(input As String, output As String)
’ Set specific settings for the TIFF output file
Dim saveOptions As TiffOptions = New TiffOptions()
saveOptions.Compression = TiffCompressions.CcittFax4

’ Load an existing image (of any type) in an instance of the Image class
Using image As Aspose.Imaging.Image = Aspose.Imaging.Image.Load(input)
image.Save(output, saveOptions)
End Using
End Sub

This works well, we get some well compressed black & white tif-images, but we would like to improve the quality of the images so they are still recognizable after conversion. Is there something in between black & white and colored?

We didn’t manage to get a different result by using another TiffCompression. The most of these are giving a exception, or gives the same output result as TiffCompressions.CcittFax4.

Can you help us?

Thanks

Christof

Hi Christof,

First of all, please accept our sincere apologies for the delayed response.

You can adjust different properties of TiffOptions class to get your desired results. Provided below is a table describing the parameter expected values that you can set in order to achieve your goals. Please note, you should set all 4 columns through TiffOptions to to save any image format to Tiff format.

TiffOptions.Photometric
TiffOptions.Compression
TiffOptions.BitsPerSample
TiffOptions.Predictor
Palette
LZW/Uncompressed
1/4/8/16 (palette, color mode) single channel only
None
MinIsWhite/MinIsBlack
LZW/Uncompressed
1/4/8/16 (gray-scale mode) single channel only
None
Palette
LZW/Uncompressed
8 (palette, color mode) single channel only
Horizontal (more compression achieved for LZW same patterns)
MinIsWhite/MinIsBlack
LZW/Uncompressed
8 (gray-scale mode) single channel only
Horizontal (more compression achieved for LZW same patterns)
RGB
LZW/Uncompressed
[8,8,8] (3 RGB channels)
None/Horizontal
RGB
LZW/Uncompressed
[8,8,8,8] (3 RGB channels and additional alpha channel may be set through TiffOptions.AlphaStorage) Actually any additional channels count is supported but each channel must have 8 bit size like [8,8,8,8,8,8]
None/Horizontal
Please note, when employing different combinations some viewers (including the Windows Photo Viewer) may refuse to render the resultant image due to the limited support they offer. In such case, please pick different viewer for your testing.

In case you find any ambiguities, please feel free to write back.

Uncompressed is no option, we want to have small images after conversion (performance).

See attachments for an example we are dealing with. Is it possible to improve the quality after conversion, by using a compression?

Hi Christof,


Thanks for sharing source file. After initial investigation, we have logged a ticket in our issue tracking system as IMAGING-33884 for further investigation and resolution. We will notify you via this forum thread as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

Has this issue been resolved?

I’m interested in the result.

Regards,

Joris

Hi Joris,

First of all, please accept my apology for the delayed response on this.

I am afraid, the ticket attached to this thread isn’t resolved yet, although you will get better quality for Tiff image formats with upcoming release of Aspose.Imaging for .NET 2.2.0. Moreover, I would suggest you to try different TiffOptions setting on your own as provided here in order to test what settings suit your needs best. In case you have a special requirements then please share your scenario details so we could assist you in this regard.

Thanks for the reply.


I’m getting a 404 when browsing to your link, though. Could something be wrong?

Hi Joris,

Sorry, I have now corrected the link. The referenced post contains a table highlighting the usage of TiffOptions with different settings. I would suggest you to check it out at your end with little variations to best suit your requirement. With different input samples, you may observe great diversity in results as well. Please also note that a few settings may result in images that cannot be viewed with Windows Photo Viewer, in that case, I would suggest you to try other popular viewers as well.

In case you have a specific requirement, please share more details so I could suggest you a solution.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.