How to Make a Thumbnail From JPG Image in C#

How to Make a Thumbnail From JPG Image in C#

A thumbnail image is a cover image of your blog post or any video. It plays a vital role in attracting visitors to your online platform. This guide will introduce to you a thumbnail generator library that offers a wide range of methods. Well, it is quite quick and efficient in terms of making thumbnails programmatically. However, let’s start and learn how to make a thumbnail from JPG image in C# and we will implement this functionality by writing a code snippet.

We will cover the following sections in this article:

Thumbnail generator library

This section will provide you complete details to set up this library in your .NET project. You may download the DLL or install this library by running the following command in the NuGet package manager.

Install-Package Aspose.Imaging

How to Make a thumbnail from JPG Image in C#

The conversion of a JPG/JPEG image to a thumbnail is a matter of writing a couple lines of source code in C# language.

Please follow the steps and the code snippet mentioned below:

  1. Load an image using the factory method Load exposed by Image class.
  2. Invoke the Resize method with the type of LanczosResample.
  3. Call the Save method to save the thumbnail image.

Copy & paste the following code into your main file:

The output can be seen in the image below:

Thumbnail generator library

Get a Free License

You can avail a free temporary license to try the API without evaluation limitations.

Summing up

This blog post provided complete details on how to make a thumbnail from JPG Image in C# programmatically. Further, there is comprehensive documentation available to modify the API calls. In addition, you may visit the documentation to know further about this thumbnail generator library.

Moreover, we suggest you follow our Getting Started guide.

Finally, 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.


Can a thumbnail be a JPG?

Yes, you can build a thumbnail generation module using this .NET library. It offers a wide range of methods to create thumbnails from JPG/JPEG images.

See Also