In the recent past, we published a blog post on building a JPG/JPEG to TIFF conversion module in a .NET application. In this article, we will learn how to convert TIFF to JPG image in C#. Since this guide is for .NET developers so we will use this TIFF to JPG conversion library written in C# and offers a huge stack of features. So, do not skip any part of this tutorial that will enable you to implement this functionality by writing a few lines of source code in C#.
The following points will be covered in this guide:
TIFF to JPG conversion library installation
This section will demonstrate the installation procedure of this .NET library. So, download the DLL or install this library by running the following command in the NuGet package manager.
Convert TIFF to JPG image in C#
To implement TIFF to JPG conversion, you may follow the steps and the code snippet mentioned below:
Please follow the steps and the code snippet mentioned below:
- Invoke the Image.Load method to load the TIFF image file and assign it to the instance of the TiffImage class.
- Loop through the frames of the TIFF image.
- Initialize an instance of the JpegOptions class.
- Create an object of the ResolutionSetting class to set the resolution for image save options.
- Set the resolution unit explicitly by setting the value of the ResolutionUnit property.
- Invoke the save method to save the TIFF image to the JPG image format.
Copy & paste the following code into your main file:
The output can be seen in the image below:
Get a Free License
You can avail a free temporary license to try the API without evaluation limitations.
This brings us to the end of this blog post. I hope you have learned how to convert TIFF to JPG image in C# programmatically. There are many other methods exposed by this TIFF to JPG conversion library. Further, you may visit the documentation to get awareness about other features.
Moreover, we suggest you follow our Getting Started guide.
Finally, conholdate.com is writing new blog posts. So, please stay in touch for regular updates.
Ask a question
You can let us know about your questions or queries on our forum.
How to convert TIFF to JPG in C#?
Please follow this link to know about the TIFF to JPG conversion in C#.