Image Conversion in
I have found in forums, that people are searching for
conversion of images between different formats.
In this article I am going to show the existing Image
conversion libraries in .Net.
Loading an Image
We can load the image from a file using Image.FromFile()
Eg: If we need to
convert a image.jpg file to image.png - specify the source path in the above
Saving an Image
The Image class contains a method Save() which can do the conversion as well. The image type can be specified using the ImageFormat class.
For saving the above
file we can use
Currently the ImageFormat class supports the following image
I think it is more than enough for our requirements.
You can use the sample application to test the conversion by
yourself. For time being I am using only
4 format. (Gif, Jpg, Png and Bmp).
On clicking the Load
button it will load the image based on type in dialog box. You can change the type filter in the
appearing Image Dialog.
The Convert To button will prompt with a
Save dialog box and you can specify the image name there. The type of image is determined by the radio
buttons in the form.