Converting 2 colors picture from TIFF to GIF

G

Guest

Hi.

In an ASP.NET page, I am converting from a TIFF picture, that has a palette
of 2 colors (1 bit), to a GIF, using the the code below, and it works fine.

The problem is that the GIF always gets a palette of 256 colors (8 bits). Is
there a way to force the GIF to have only 2 colors?

Thanks in advance.


'============= BEGIN MY CODE ===============
Dim img As System.Drawing.Bitmap

img = System.Drawing.Bitmap.FromFile(Server.MapPath("/") & "pic1.tiff")

img.Save(Server.MapPath("/") & "pic2.gif",
System.Drawing.Imaging.ImageFormat.Gif)

img.Dispose()
img = Nothing
'============= END MY CODE ===============
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top