PNG Dpi

Hello,
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?
Thanks :slight_smile:

Sorry is using:
PngOptions.ResolutionSettings = New Aspose.Imaging.ResolutionSetting(96.0, 96.0)
the same as:
ResolutionSettings.HorizontalResolution = 96.0
ResolutionSettings.VerticalResolution = 96.0
?

Png does not have?
PngOptions.ResolutionUnit = Aspose.Imaging.ResolutionUnit.Inch

Thanks :slight_smile:

And a last suggestion, on your help pages, please specify the default and valid ranges of numeric properties.

sample1, PngOptions.BitDepth which values are supported? I thing the default is 8 right?

sample2, PngOptions.ResolutionSettings / H/V Resolution what’s min and max values?

Thanks :slight_smile:

@australian.dev.nerds Thank you for your interest in our product and your feedback on our documentation. To help us investigate the issue you reported, please send us a sample file and a code snippet that can reproduce the problem. Also, please specify which version of Aspose.Imaging you are using. This information will help us to identify and resolve the issue faster. Thank you for your cooperation.

1 Like

@australian.dev.nerds
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): IMAGINGNET-6728

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

Hello, what’s this for? IMAGINGNET-6728 :slight_smile:
PngOptions.ResolutionSettings not honored?

Hi, @australian.dev.nerds.
About this

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. :slight_smile:

This enumerate

Aspose.Imaging.ResolutionUnit
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? :slight_smile:

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

About

PngOptions.ResolutionSettings not honored?

No, PngOptions.ResolutionSettings are honest. :slight_smile:
In my view, Alexey created the issue IMAGINGNET-6728 by mistake.
Hope, I was able to help.