The Artima Developer Community
Sponsored Link

.NET Buzz Forum
My gifs are too noisy

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Paschal

Posts: 1621
Nickname: bigapple
Registered: Nov, 2003

Paschal is a .Net developer
My gifs are too noisy Posted: Jul 1, 2004 9:54 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Paschal.
Original Post: My gifs are too noisy
Feed Title: help.net
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/pleloup/Rss.aspx
Feed Description: .Net for mankind !
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Paschal
Latest Posts From help.net

Advertisement

I need some help. I wrote some code to pull some images from a database and write them on a web page. Nothing special, the code is working well, except for one very annoying thing.

The pictures in Gif format come out with some noise (see example), dithered if you prefer. I know how to fix the problem for the images I create myself using a Graphics object but I can't figure out how to solve this one.



The JPeg are fine, but I am stuck with the Gifs.

I am sure it has something to do with ContentType, because my data is in a Stream, so obviously has to know the mime type to render the right format.

I tried this, but no success (the code is longer than that, but I removed  the database part):

Dim bmp As Bitmap= New Bitmap(Processtoretrievemypicture)

HttpContext.Current.Response.ContentType = "image/gif"

bmp.Save(HttpContext.Current.Response.OutputStream, ImageFormat.Gif)

If only I could use the same method as I did before with a Graphics object like this:

Dim g As System.Drawing.Graphics

g.TextRenderingHint = TextRenderingHint.AntiAlias

This was the right solution but now I don't find a way to associate this with my Stream. I got this error message:

A Graphics object cannot be created from an image that has an indexed pixel format

By the way I found also a nice GDI+ Faq.

 

Read: My gifs are too noisy

Topic: JavaOne Day Three Previous Topic   Next Topic Topic: The Broken - somewhat interesting

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use