473,387 Members | 1,619 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,387 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 50768
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.