This article serves as a comprehensive guide on how to convert DICOM images to JPG, PNG, BMP, and GIF formats in C# using the powerful Aspose.Imaging library.

What is DICOM?
DICOM (Digital Imaging and Communications in Medicine) is a standardized format widely used for storing and sharing medical imaging data. It includes both header and image information, typically found in scans such as ultrasounds and MRIs. These images are essential for healthcare professionals to convey critical patient information effectively.
While numerous offline and online DICOM viewers exist, embedding DICOM images into presentations or web pages often necessitates conversion to more universally accepted formats like JPG, GIF, PNG, or BMP. In this article, you will learn how to programmatically convert DICOM images using C#. By the end of this guide, you’ll be proficient in converting DICOM images into the following formats:
- JPG
- GIF
- PNG
- BMP
Efficient DICOM Conversion with C# - Free Download
To efficiently convert DICOM images, we will leverage Aspose.Imaging for .NET, a user-friendly API designed for creating and manipulating various image types within .NET applications. You can find Aspose.Imaging for .NET on NuGet and download the binaries for integration.
Converting DICOM to JPG in C#
To convert a DICOM file to JPG in C#, follow these steps:
- Load the DICOM file into a FileStream object.
- Create an instance of the DicomImage class and initialize it with the FileStream object.
- Select the active page in the DICOM file for conversion to JPG (the default active page will be used if none is set).
- Save the converted JPG image using the DicomImage.Save(string, ImageOptionsBase) method.
Here’s a code sample that demonstrates how to convert a DICOM page to JPG in C#:
Example Input DICOM

Output: DICOM to JPEG

Converting DICOM to GIF in C#
The process for converting DICOM to GIF is straightforward. Simply access the DICOM file and save it with the .gif extension. Here’s how:
- Access the DICOM file using the DicomImage class.
- Save the converted GIF image using the DicomImage.Save(string, ImageOptionsBase) method.
Here’s a code sample for converting DICOM to GIF in C#:
C# DICOM to PNG Conversion
Converting DICOM to PNG follows a similar process to converting to JPEG. Access the DICOM file using the DicomImage class and save it with the .png extension. Here’s a code sample for converting DICOM to PNG in C#:
Exporting DICOM to BMP in C#
To convert DICOM to BMP, follow the same steps as before to access the DICOM file using the DicomImage class. Once accessed, use the DicomImage.Save(string, ImageBaseOptions) method to save the DICOM as BMP. Here’s a code sample for this conversion:
Conclusion
In this article, you have learned how to convert DICOM images to PNG, JPG, BMP, and GIF formats using C#. You can seamlessly integrate the provided code samples into your applications for efficient DICOM conversions, all facilitated by the affordable Aspose Plugin at just $99.
Learn More About C# DICOM to Image Conversion
Explore more about working with images using the Aspose.Imaging for .NET API.
Additional Resources
Info: You may find the Aspose Text to GIF web app interesting.
Keywords: DICOM to JPEG, DICOM to PNG, DICOM to GIF, DICOM to BMP, .NET DICOM Converter, Medical Image Processing, High-Performance DICOM Conversion, OCR, Image to Text, PDF to Text, Invoice Processing, Data Extraction, Table OCR, Text Recognition, Document Conversion.