Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphic display quality 1

Status
Not open for further replies.

dave755

IS-IT--Management
May 3, 2001
69
0
0
US
I have an application that is generating graphics on the fly from user input and database content. There is an issue involving the quality of the displayed image.

** If I save the image as a [blue]BMP[/blue], it looks great but the image is 1650Kb and loads slowly.
** If I save the image as a [blue]JPG[/blue], the file is only 26Kb, but it looks awful - grainy and with those "halo" effects that JPG's are famous for.
** If I save the image as a [blue]GIF[/blue], it is also a small file, but all the colors come out dithered and it really does not look the way it should.

Suggestions?

Dave Gee
 
You can try a .PNG file, but some browsers (IE, mostly) have difficulties displaying them if the .png file uses some of the more obscure features of the PNG format.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
The PNG format works great. Thank you.

Dave Gee
 
chiph: Good point. We have abandoned *.png (except as an option) Too many computers for various reasons cannot display *.png images - we found in our survey that up to 1 in 5 computers could not display them (just a random survey at a local Univeristy).
 
I can actually help someone here! Awsome.

I can fix your GIF issue but it'll take some convicing to get a web host to run your code (it uses 'unsafe' methods).

If you are interested and wish to know more post back and I'll post library I used on my server and run you through a quick demo.


Yet another unchecked rambling brought to you by:
Oddball
 
Thanks for the offer, Oddball. I think I will wait and see before jumping through that hoop.

This application has a very limited audience (fewer than a dozen individuals). It seems that there is a good possibility that I will be able to get away with PNG files.

FYI: the graphics are created using GDI+ functions. Nothing too fancy, just lines, rectangles, pie slices, and text. The server is IIS - either localhost running on WinXP Pro or remote running Win2003 Server.

Dave Gee
 
Your problem is with the colour pallet that the GDI+ libraries use to quantize your image into a GIF.

There's a big science grown up arround quantizing images - with any number of long words and formulas involved.

The only one you really need, though, is Octree Quantizer. I can provide the classes for you and if you're running your own servers (and have control of the security policies) then you won't have any problems.

I use these classes for meanial things like rendering chamfer boxes to make my pages look good (boxes with rounded corners) and for making text on the fly with non-standard fonts.


Yet another unchecked rambling brought to you by:
Oddball
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top