473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Convert Tiff Images to Gif/Jpeg

Hello friends,

Can any body tell me the sample code to convert a Tiff image to a Gif
or Jpeg format. The Resolution of picture is a big concern keeping in
mind.
Hope to get the response from all of you.

Regards,
Pushp
Nov 17 '05 #1
4 50718
Load the file...

Bitmap bm=Bitmap.FromFile("mypic.tiff");

save as jpeg...

bm.Save("mypig.jpg",ImageFormat.JPEG);

Saving to GIF is a variation on the theme.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Pushp" <pu*********@gmail.com> wrote in message
news:46**************************@posting.google.c om...
Hello friends,

Can any body tell me the sample code to convert a Tiff image to a Gif
or Jpeg format. The Resolution of picture is a big concern keeping in
mind.
Hope to get the response from all of you.

Regards,
Pushp

Nov 17 '05 #2
Hi !

Bob Powell wrote:
Load the file...

Bitmap bm=Bitmap.FromFile("mypic.tiff");
Shouldn't that read

Bitmap bm = new Bitmap("mypic.tiff");

?

save as jpeg...

bm.Save("mypig.jpg",ImageFormat.JPEG);


But keep in mind that TIFF-files may contain more than one image. Have a
look at Bitmap.SaveAdd.
Nov 17 '05 #3
Actually, FromFile works because its in the base class of Bitmap so either
one will do.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Michael Voss" <mi********************@lvrREMOVE.CAPSde> wrote in message
news:42525768$1@news...
Hi !

Bob Powell wrote:
Load the file...

Bitmap bm=Bitmap.FromFile("mypic.tiff");


Shouldn't that read

Bitmap bm = new Bitmap("mypic.tiff");

?

save as jpeg...

bm.Save("mypig.jpg",ImageFormat.JPEG);


But keep in mind that TIFF-files may contain more than one image. Have a
look at Bitmap.SaveAdd.

Nov 17 '05 #4
Yes. you're correct...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Michael Voss" <mi********************@lvrREMOVE.CAPSde> wrote in message
news:42525768$1@news...
Hi !

Bob Powell wrote:
Load the file...

Bitmap bm=Bitmap.FromFile("mypic.tiff");


Shouldn't that read

Bitmap bm = new Bitmap("mypic.tiff");

?

save as jpeg...

bm.Save("mypig.jpg",ImageFormat.JPEG);


But keep in mind that TIFF-files may contain more than one image. Have a
look at Bitmap.SaveAdd.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Paul | last post by:
I have tiff images stored in a sql database as image datatype. Through code, I will do a select statement on the table and need to output a selected tiff in my browser. I realize that browsers do...
4
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to...
3
by: Kim Schulz | last post by:
hi anyone that know some free code to convert ppm to jpeg in c#? Best regards Kim Schulz
0
by: Zhao Sheng | last post by:
http://www.guangmingsoft.com/htmltoimage/help.htm Html To Image Html To Image 2.0 Released! Html To Image help you convert html page from any URL to image or thumbnails easily and quickly. ...
5
by: Sameer Gupta | last post by:
what are options for opening / handling tiff files in .Net framework ? which is the best library, namespace ? Please help Regards Sameer Gupta C# Designer & Developer Siemens UK
0
by: wbsmith | last post by:
hello all, i am using python (2.5) with the PIL (latest release), and i am trying to read in these 3-d tiff images we have. basically, i am following some example code that iterates through...
1
by: Scott Elgram | last post by:
Hello everyone, I'm hoping someone here can pose an alternative that might work better than what I have created so far. I have a web site that needs to deal with Multi-Page TIFF images. ...
1
by: a.mustaq | last post by:
Hi All, In my application, I have to display tiff images stored on server. Please help me in acheaving this. With Regards, Mustaq Ahmed.A
0
by: snehal s | last post by:
How to merge tiff images which may be multipage or single page using C# in VS 2005?
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.