PngOptions.ResolutionSettings = New Aspose.Imaging.ResolutionSetting(96.0, 96.0)
PngOptions.ResolutionSettings = New Aspose.Imaging.ResolutionSetting(300.0, 300.0)
PngOptions.ResolutionSettings = New Aspose.Imaging.ResolutionSetting(1200.0, 1200.0)
I loaded a Tiff file to save as Using any of the above parameters will make no difference when saving as PNG and the same file will be made, any idea?
Please let me know, what difference did you expect.
The HorizontalResolution and VerticalResolution could be equal to any positive value.
Meanwhile, please, take into account that image resolution is only hint for printing software what size this image has in inches (HorizontalResolution and VerticalResolution are only dividers for calculating the final size of the image in inches). And nothing more.
is supported only by Jpeg format specification, it allows to set HorizontalResolution/VerticalResolution values as dividers for calculating the final size of the image in inches or in centimeters. This feature is only supported by Jpeg. In other formats only ResolutionUnit.Inch is supported.
In the case of PNG, you can see the difference only in Windows Explorer at the properties of the image, in the tab “Details”.
If you wish to resize the image you should use the methods RasterImage.resize/RasterImage.ResizeHeightProportionally/RasterImage.ResizeWidthProportionally and so on.
Why so difficult?
The problem is in the fact that different image formats have different supported options, compressions, and additional information could be stored inside. That is why we need the different
Bmp/Tiff/Tag/...Options for export. Unfortunately, they could not be merged into one class ImageOptions.
The meaning of each property is described in detail in the image format specification that can be easily found on the Internet.
Talking about the PngOptions.BitDepth
This property can have a value
- 1/2/4/8 for PngOptions.ColorType == PngColorType.Grayscale or PngColorType.IndexedColor
- 8 for PngOptions.ColorType == PngColorType.GrayscaleWithAlpha
- 8/16 for PngOptions.ColorType == PngColorType.Truecolor or PngColorType.TruecolorWithAlpha
PngOptions.ResolutionSettings not honored?
No, PngOptions.ResolutionSettings are honest.
In my view, Alexey created the issue IMAGINGNET-6728 by mistake.
Hope, I was able to help.