GIF quality when saving from .net is bad...way to fix?

D

darrel

I have written an image upload/resize tool that then saves out the image as
either a JPG or GIF.

I got the JPG save working nicely, using a codec and setting the compression
to 90%.

However, I can't seem to manipulate the GIF using the same parameter. All my
GIFs appear to be using a restricted pallette (reduced windows system?) and
they all come out incredibly grainy. Is there away to change the color
pallet the GIF uses when saving? Ideally, I'd like it to be an adaptive
pallet of colors found in the image itself (similiar to how Macromedia
Fireworks saves images).

Google/MSDN turn up lots of tutorials on changing JPG quality in .net, but I
haven't found a single one on GIFs yet...

-Darrel
 
R

Rick Strahl [MVP]

If I remember right you have to set the Palete manually. You can capture the
original palete of the image
and assign it to your new image after manipulation, but you may still have
problems if you're
adding new colors.

There's an MSDN article that talks in some detail about this here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/colorquant.asp

and there are number of related articles that talk about transparent GIFs
which deal with
this issue as well (custom paletes).


+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top