Save Images with better quality?

akrocks
04-26-2006, 04:27 PM
When I save my images generated by my program, the quality is really low. Especially when saved as gif's, but even bmp's have poor quality.

Where exactly do you set the quality? My guess was image.palette, but i tried to set it to the picturebox's palette where the images come from and got an error.

Iceplug
04-26-2006, 05:42 PM
The quality of GIFs depends on the palette - .NET doesn't exactly cover the whole grounds of saving GIFs - they are always the same palette as the original (or the default GIF palette).
See http://www.bobpowell.net/giftransparency.htm for a point in a direction on how to change the palette. :)

OnErr0r
04-26-2006, 06:02 PM
http://www.xtremevbtalk.com/showthread.php?t=128891

Btw, I've been experimenting with the median-cut algorithm lately, and it gives even better results than an octree.

akrocks
04-26-2006, 09:57 PM
ahh.. everything has to be so complicated.... :( :p i was hoping there was just a simple varible i could set..... grrr... ok... i guess its time to start coding....
keep me posted on whatever you come up with. thanks.

akrocks
04-27-2006, 05:03 PM
So answer me this...
Is it as "easy" as grabbing each color from the original image and then just create a palette, from those colors, in the new image object I save with?
I mean, that quantize sample works good and all... but its just so much code to save a simple gif.. If thats the way it has to be, thats what I'll have to do... but simple is best.

Why didnt they impliment something to take care of this in the first place? grr :-\

akrocks
04-27-2006, 07:33 PM
Ok, sorry for the tripple posts.. But, this is what I was kinda looking for:
http://msdn2.microsoft.com/en-us/library/system.drawing.imaging.encoder.quality.aspx
I tried it out and it works fine for jpegs, but not when saving gifs. I know jpegs have better quality in general (used for photographs), but all I'm trying to save are some basic graphics.

OnErr0r
04-27-2006, 09:40 PM
Encoder quality is for JPG images. Grabbing each color from the original image would work, but only if there were 256 or less of them. When there are more colors, that is when quantization is necessary.

akrocks
04-27-2006, 11:39 PM
a. oh, then that would explain the encoder.....

b. ok! then that should work for me! ... maybe... I dont think any of my images will have more than 256 colors..... in less they are user created, then they might.... but.. they shouldnt........

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum