Save Properties

Some questions on save options, if you don’t mind please?

Property BitsPerPixel is ReadOnly, so how to set the big depth of saved images, ie 16-bits vs 24-bits vs 32-bits vs 48-bits vs 64-bits

How to set the DPI when saving?

And is there any Boolean property to enable/disable these 3 when saving?
Grayscale - Anti Aliasing - High Quality Rendering Mode

Thanks :slight_smile: , derived from ImageOptionsBase classes are used for specifying bitsPerPixel property for image export. For example take a look at:

As for Anti Aliasing and High Quality Rendering Mode options control you should set ImageOptionsBase.VectorRasterizationOptions for Vector format images:
or Graphics class properties for Rasters:

1 Like

Hello and thanks, however, the docs won’t specify valid values for BitDepth properties of:

And I didn’t find the b/w or grayscale property for:
TiffOptions / TgaOptions / GifOptions / BmpOptions / Jpeg2000Options
Do they have a boolean property for grayscale saving?
Thanks :slight_smile: ,
use PngOptions.ColorType property to set BitsPerPixel (TruecolorWithAlpha = 32, Truecolor = 24, other are 1 - 8). By the way, one of upcoming releases is going to contain updated PngOptions class with more informative code docs.

As for TIFF, this format uses more advanced options. Take a look here, consider TiffOptions(TiffExpectedFormat) ctor and BitsPerSample property: Manipulating TIFF Images|Documentation
You are getting grayscale export image due to using TiffOptions ctor with TiffExpectedFormat.Default resulting a BW. Try using new TiffOptions(TiffExpectedFormat.Jpeg) to keep color, take a look at code reference.

This thing with ‘Grayscale’ is about using default TiffOptions, other formats preserve colors by default or can be configured to export a grayscale. Please take a look at the different image options specs. You could also take a look at Grayscale | Aspose.Imaging for .NET API Reference.

1 Like

Thanks a lot, so if I understand you correctly, for:

TgaOptions / GifOptions / BmpOptions / Jpeg2000Options

There’s no direct grayscale property, and I will have to try cast to image to RasterImage, set Grayscale and then save?

If true, how do you think about registering a feature request ticket for:
TgaOptions / GifOptions / BmpOptions / Jpeg2000Options
direct grayscale boolean property, so won’t need additional rasterimage cast, like other formats?
Best. , you should explore specs of different options:

  • PngOptions/JpegOptions have grayscale color modes;
  • some other formats do not support Grayscale mode as a part of specification, so indeed you should RasterImage.Grayscale() and then specify export options.
1 Like


yep, I wonder why JpegOptions has but Jpeg2000Options does not have .ColorType
They’re similar formats though… , JPEG and JP2000 are not the same formats, but the thing is that our Jpeg2000Image currently supports only RGB colorspace (24-bpp) on save/export.

1 Like

A dcm file which is 87.5 mb and saved by Photoshop when loaded into Aspose to be saved as jpeg, will not succeed:
Image saving failed.
Smaller files saved by the same Photoshop will be loaded, a known issue?

Same thing happens when saving as Tga:
Image saving failed.

If load a dng to be saved as jpg, a black border line is painted in the left and top of result image! Also known?

Thanks :slight_smile: , would you mind to share the code examples and the files you are using that raise exceptions? So we can test it out.

1 Like

Seems if images are a little large such errors will happen, please be so kind and check these 2 error in a project which seem to be bugs: , let me test your sample. You will be answered shortly!

1 Like
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.


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