Author |
Topic  |
|
FPHealthcare
22 Posts |
Posted - 03 Sep 2006 : 19:08:50
|
I am using QCChart2D to create a JPEG image which is then used as part of a report. The image contains 4 charts with usual scales, text, legends etc.
The X and Y axes for all 4 charts are very sharps, as are the tick marks. The charts themselves (bar, line scatter) are also clear. However all the text, including axes lables, axes titles, legends, chart text etc are all very blury. I have tried printing in both colour and b&w, and same results. I've tried using different resolutions, and the only difference that seems to make is making the text smaller or larger.
I can email the image if that will make things any easier.
Is there a way to create a sharper clearer image?
Thanks |
|
quinncurtis
1164 Posts |
Posted - 04 Sep 2006 : 09:14:21
|
First, what happens when you run our LinePlotSalesVolume example, and save the graph as a file using the File | Save Image menu option, and specify JPG as the file extension for the image file name, which should cause it to be save in jpeg format ?
When we run that program and view the result using Windows Picture and Fax Viewer, and Paint, we can see no degradation of the text.
You can also view a ASP.NET example that creates jpeg files on demand and uploads them for viewing at our web page:
http://www.quinn-curtis.com/Chart2DAspWebApp.htm
You can experiment with the jpeg resolution and see how it affects the text resolution. At 100% we see no sign of text degradation.
|
 |
|
FPHealthcare
22 Posts |
Posted - 12 Sep 2006 : 17:24:16
|
LinePlotSalesVolume comes up ok. However if you look at the 'Stock Performance vs NASDAQ' image at the top left this screen, you'll see there's some artifacts around the numbers. This is what's happening to our chart. Also the same happens on http://www.quinn-curtis.com/Chart2DAspWebApp.htm. If you zoomed in on the image, you'll see it quite clearly around the numbers. Is there a way to change this? |
 |
|
quinncurtis
1164 Posts |
Posted - 13 Sep 2006 : 08:52:33
|
When we view the images in a browser with 32-bits of color resolution, we see some, but not very significant, degradation. If you look at the images on a system that has less than 32-bits of color resolution, the images will appear much more degraded. You must also size the image, which placed on a web page, to exactly the same size as the source image.
That is a basic limitation of using the jpeg image file format. The format was designed for photographs and other greyscale type images. It is not the best method for reproducing text, charts and other types of images that have sharply defined lines. This is well discussed on the web.
Our software does not do the actual jpeg compression. We just send the raw image bitmap off to the the standard .Net routines, which do the compression. So there is nothing that we can suggest that will improve the jpeg images. What you should be using instead is one of the non-jpeg image file formats (BMP, TIFF, PNG or GIF) that does not use "lossy" compression. These file formats are more appropriate to sharp edged text and lines. The resulting file size will be bigger, but this is the trade-off you must make if you want perfect images with razor sharp text. See http://www.ou.edu/class/digitalmedia/articles/CompressionMethods_Gif_Jpeg_PNG.html for for a discussion.
|
 |
|
Josh
23 Posts |
Posted - 09 May 2008 : 13:56:25
|
For anyone else not satisified with the image quality due to jpeg compression and trying to save the BufferedImage to the Response.OutputStream in ASP.NET, here's the code to do so:
Dim ms As New System.IO.MemoryStream()
Dim bi As BufferedImage = SPC_Charts.GetChartImage(Size, Style, ImageFormat.Png)
bi.SaveImage(ms)
ms.WriteTo(context.Response.OutputStream) If you just attempt to save the BufferedImage directly to the OutputStream, you will receive a GDI+ exception. This is because the encoder for PNG's require a bi-directional stream.
Note that I'm using a custom class named SPC_Charts to generate my charts through a GetChartImage function. |
 |
|
|
Topic  |
|
|
|