We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Image generated with poor quality

Hello Team,

We have implemented all suggestion provided till now but still we are not stratified quality of generated image. Please refer attached sample application for same. Image with name output.png will be generated in ImagesOutput folder when you run sample application. Please suggest us how can we achieve best quality image in our requirement.

SampleApplication.zip (8.5 MB)

@siriussynoptek
Please review attached quality testing output.quality-test-output.zip (9.1 KB)
If it suits you, we may share further recommendations.

Hi Team,

We have reviewed image that you have shared with us. We have tried to compare it with image generated by sample application that we have shared with you and found that almost both images are same. No quality difference found. Can you please share recommendations with us so that we can apply it in our actual application and check the generated image quality? Also, can we know what quality parameter you have considered when generate this image?

Thanks.

@siriussynoptek
Also, can we know what quality parameter you have considered when generate this image?
We’ve considered

    CompositingQuality = CompositingQuality.HighQuality,
    InterpolationMode = InterpolationMode.HighQualityBicubic

Can you please share recommendations with us so that we can apply it in our actual application and check the generated image quality?
We recommend avoiding raster image zoom after the text output or use not raster image formats, where text kept not rasterized and enjoi zoom quality. All the rest is in your hands.

@siriussynoptek
The fact that you are not satisfied with the display of the font is called ClearType, more details here: https://en.wikipedia.org/wiki/ClearType
This can be turned off, the font will look as expected when zoomed in, but will be angular in normal viewing.
No other has yet been invented…
example:

 using (MemoryStream ms = new MemoryStream())
 using (Image image = Image.Create(new PngOptions(){Source = new StreamSource(ms)}, 500, 500))
 {
     Graphics graphics = new Graphics(image);
     graphics.Clear(Color.White);
     graphics.DrawString("Hello World - 1", new Font("Arial", 36, FontStyle.Regular), new SolidBrush(Color.Black), 0,0);
     graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixel;
     graphics.DrawString("Hello World - 2", new Font("Arial", 36, FontStyle.Regular), new SolidBrush(Color.Black), 0, 100); 
     image.Save(@"D:\1.png");
 }

Hello World - 1 - with ClearType
Hello World - 2 - without ClearType
result: 1.png (2.6 KB)

Perhaps - graphics.TextRenderingHint = TextRenderingHint.AntiAlias; Will be a compromise solution,
result with AntiAlias: AntiAlias.png (3.5 KB)

Hello Team,

Is there any new method or feature invented in latest version to improve generated image quality?

Is there any way to create Font object without specifying font size?

@siriussynoptek, you still can use vector images for better quality of text as we wrote above. We don’t have any other changes and plans related to this. Related to font creation, you can not create font and after that use it without specifying font size.