PNG and JPG format are well-known raster image file formats that contain single-layer visual information. Whereas, the Photoshop Document (PSD) file contains several layers to display the pictures. You can easily convert PNG or JPG images to PSD format programmatically using C# in your .NET applications. This article covers the following sections related to PNG and JPG image conversion:
- PNG or JPG Image to PSD Converter – C# API Installation
- Convert PNG Image to PSD File Programmatically using C#
- Convert JPG Image to PSD Programmatically using C#
- Get Free License
PNG or JPG Image to PSD Converter – C# API Installation
PNG or JPG to PSD conversion is helpful in scenarios like where different designers design layers that are later combined into a single image using PSD format. For instance, game fields, multi-layer maps, graphic assets contain a lot of visual information. You need to configure Aspose.PSD for .NET API to work with several supported file formats. You can quickly install the API by downloading the DLL files from the New Releases section, or with the following NuGet installation command:
PM> Install-Package Aspose.PSD
Convert PNG Image to PSD File Programmatically using C#
You can convert PNG image to PSD file by following the steps below:
- Initialize PsdImage class object.
- Load input PNG image into FileStream object.
- Add input image as a layer to PSD image with AddLayer() method.
- Convert the image to output PSD file with Save() method.
The following code shows how to convert PNG image to PSD file programmatically using C#:
The following screenshot shows sample output of PNG Image to PSD conversion:
Convert JPG Image to PSD Programmatically using C#
You can convert JPG image to PSD file with the following steps:
- Initiate PsdImage class instance.
- Load input JPG image into FileStream object.
- Add input JPG file layer to PSD file with AddLayer() method.
- Convert JPG image to output PSD file with PsdImage.Save() method.
The code below explains how to convert JPG image to PSD file programmatically using C#:
Get Free License
You can evaluate the API in full capacity by getting a Free Temporary License.
In this article, you have learned how to convert PNG or JPG images to PSD files programmatically using C#. The input image is added as a layer in the output PSD file, where you can also combine one or more images in the output file. Curious to learn more? Please feel free to visit the Documentation for exploring more features. You can contact us anytime at the Free Support Forum in case you want to discuss your use case with us!