Manipulating DNG Images
Contents
[
Hide
]
Aspose.Imaging for .NET now supports the DNG (Digital Negative) image format (.dng). It is a publicly available archival format for the raw files generated by digital cameras. DNG helps ensure that photographers will be able to access their files in the future.
Converting DNG to JPEG
Aspose.Imaging for .NET provides the DngImage class to load DNG files and same can be used to convert the DNG to raster formats. The following code snippet shows how to convert a DNG file to JPEG format.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Imaging; | |
using Aspose.Imaging.FileFormats.Bmp; | |
using Aspose.Imaging.FileFormats.Dicom; | |
using Aspose.Imaging.FileFormats.Djvu; | |
using Aspose.Imaging.FileFormats.Eps; | |
using Aspose.Imaging.FileFormats.Eps.Consts; | |
using Aspose.Imaging.FileFormats.Jpeg; | |
using Aspose.Imaging.FileFormats.Jpeg2000; | |
using Aspose.Imaging.FileFormats.Pdf; | |
using Aspose.Imaging.FileFormats.Png; | |
using Aspose.Imaging.FileFormats.Psd; | |
using Aspose.Imaging.FileFormats.Svg; | |
using Aspose.Imaging.FileFormats.Tiff.Enums; | |
using Aspose.Imaging.ImageFilters.FilterOptions; | |
using Aspose.Imaging.ImageOptions; | |
using Aspose.Imaging.Sources; | |
using Aspose.Imaging.Xmp; | |
using Aspose.Imaging.Xmp.Schemas.Dicom; | |
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Threading.Tasks; | |
string templatesFolder = @"c:\Users\USER\Downloads\templates\"; | |
string dataDir = templatesFolder; | |
// Create an instance of Image class and load an exiting DNG file. | |
// Convert the image to DngImage object. | |
using (Aspose.Imaging.FileFormats.Dng.DngImage image = (Aspose.Imaging.FileFormats.Dng.DngImage)Image.Load(dataDir + "template.dng")) | |
{ | |
// Create an instance of JpegOptions class. | |
// convert and save to disk in Jpeg file format. | |
image.Save(dataDir + "result.jpg", new Aspose.Imaging.ImageOptions.JpegOptions()); | |
} | |
//System.GC.Collect(); | |
File.Delete(dataDir + "result.jpg"); |