An image file format is a standard method for organizing and storing images on devices like computers, tablets, and smartphones. Digital images store image data in a 2-dimensional grid of pixels where each pixel is a representation of color in terms of a number of bits. Image file types are classified into vector image formats and raster image formats. 3D Images are another type of vector image file format that is used for managing 3D images.
Raster formats
Raster Graphics are digital images that comprise pixels data for the representation of colors. These are the most common image types for graphics used for the web as well as digital photos. Some of the raster images can be compressed to reduce image file size. Common raster image file extensions and their file formats include BMP (Bitmap image file), PNG (Portable Network Graphics), and GIF (Graphics Interchange File).
Vector formats
Vector images are defined by 2D points, instead of pixels, which are connected to give a geometric shape to the image. The points have properties that define the direction of paths, color, shape, curve, thickness, and fill. Common vector image file extensions and their file formats include SVG (Scalable Vector Graphics), EPS (Encapsulated PostScript language), and PDF (Portable Document Format).
Converting an image into a PDF file is a common use case for example when you need to create a PDF document from a scanned paper. GroupDocs.Conversion allows resolving this task easily and intuitively just using a few lines of C# code as described below:
Create an instance of the Converter class and pass the source JPG file path as a constructor parameter. You may specify absolute or relative file paths as per your requirements.
Create an instance of the PdfConvertOptions class.
Call the Convert method and pass the filename for the converted PDF file and the PdfConvertOptions object from the previous step as parameters.
// Load the source JPG fileusing(varconverter=newGroupDocs.Conversion.Converter("sample.jpg")){// Set the convert options for PDF formatvaroptions=newPdfConvertOptions();// Convert to PDF formatconverter.Convert("converted.pdf",options);}
NOTE: The code example above is the same for other image formats into PDF conversion, the only difference - you have to provide the file name with the appropriate extension.
Convert image to Excel
If you need to get data from your previous tax returns into Excel and you only have printed copies just take a picture of each one and convert these images into XLS/XLSX workbook.
Convert JPG to XLS
// Load the source JPG fileusing(varconverter=newGroupDocs.Conversion.Converter("sample.jpg")){SpreadsheetConvertOptionsoptions=newSpreadsheetConvertOptions{Format=GroupDocs.Conversion.FileTypes.SpreadsheetFileType.Xls};// Save converted XLS fileconverter.Convert("jpg-converted-to.xls",options);}
// Load the source PNG fileusing(varconverter=newGroupDocs.Conversion.Converter("sample.png")){SpreadsheetConvertOptionsoptions=newSpreadsheetConvertOptions{Format=GroupDocs.Conversion.FileTypes.SpreadsheetFileType.Xls};// Save converted XLS fileconverter.Convert("png-converted-to.xls",options);}
You can choose from a variety of spreadsheet formats using the SpreadsheetFileType class, including XLS, XLSX, ODS, and others.
Convert image to PowerPoint presentation
If you need to make a PowerPoint presentation from images of PNG, JPG/JPEG, TIF/TIFF, GIF, or other formats, a possible solution is to convert them programmatically. Let’s review several code examples in C# language below and see how to transform an image into a PPT/PPTX presentation.
Convert JPG to PPT
// Load the source JPG fileusing(varconverter=newGroupDocs.Conversion.Converter("sample.jpg")){PresentationConvertOptionsoptions=newPresentationConvertOptions{Format=GroupDocs.Conversion.FileTypes.PresentationFileType.Ppt};// Save converted PPT fileconverter.Convert("jpg-converted-to.ppt",options);}
// Load the source PNG fileusing(varconverter=newGroupDocs.Conversion.Converter("sample.png")){PresentationConvertOptionsoptions=newPresentationConvertOptions{Format=GroupDocs.Conversion.FileTypes.PresentationFileType.Ppt};// Save converted PPT fileconverter.Convert("png-converted-to.ppt",options);}
You can choose from a variety of presentation formats using the PresentationFileType class, including PPT, PPTX, ODP, and others.
Convert image to Microsoft Word document
To easily transform images into Microsoft Word documents programmatically, please check the following code snippet in C#:
// Load the source JPG fileusing(varconverter=newGroupDocs.Conversion.Converter("sample.jpg")){varoptions=newWordProcessingConvertOptions();// Save converted DOCX fileconverter.Convert("jpg-converted-to.docx",options);}
Converting between different image formats is a common requirement. For example, you may need to convert PNG to JPG for smaller file sizes, or convert to TIFF for archival purposes.
Convert PNG to JPG
// Load the source PNG fileusing(varconverter=newGroupDocs.Conversion.Converter("sample.png")){varoptions=newImageConvertOptions{Format=GroupDocs.Conversion.FileTypes.ImageFileType.Jpg};// Save converted JPG fileconverter.Convert("png-converted-to.jpg",options);}
// Load the source JPG fileusing(varconverter=newGroupDocs.Conversion.Converter("sample.jpg")){varoptions=newImageConvertOptions{Format=GroupDocs.Conversion.FileTypes.ImageFileType.Png};// Save converted PNG fileconverter.Convert("jpg-converted-to.png",options);}
Convert image to TIFF
TIFF (Tagged Image File Format) is widely used for storing high-quality images. You can convert any supported image format to TIFF:
// Load the source image fileusing(varconverter=newGroupDocs.Conversion.Converter("sample.jpg")){varoptions=newImageConvertOptions{Format=GroupDocs.Conversion.FileTypes.ImageFileType.Tiff};// Save converted TIFF fileconverter.Convert("converted.tiff",options);}
You can choose from a wide range of supported image formats using the ImageFileType class, including: BMP, GIF, ICO, JP2, JPEG, PNG, PSD, SVG, TIFF, WEBP, and many others.
For advanced image conversion options like setting image quality, resolution, and other parameters, refer to the Convert to image with advanced options article.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.