Recently in one of project we had a requirement of converting a Adobe Photoshop file (PSD) into image file(.png) file. After digging while on internet I have found a great library which has so many features in can easily convert PSD files into any time of image file.
The Library is Magick.NET. It’s a open source project you can find more information about it from the following codeplex link.
https://magick.codeplex.com/
There are lots of example available for image conversion and other image editing functions. You can find that about that on documentation.
https://magick.codeplex.com/wikipage?title=Convert%20image
There are lots of NuGet package are available also. Following is a one of them.
So what are we waiting for it’s time to create console application and adding a NuGet package.
I have added NuGet like below from package manager console.
For this example I have downloaded some sample PSD file from internet and need to convert that into .png file. Following is a code for that.
That’s it. Hope you like it. Stay tuned for more!!
The Library is Magick.NET. It’s a open source project you can find more information about it from the following codeplex link.
https://magick.codeplex.com/
There are lots of example available for image conversion and other image editing functions. You can find that about that on documentation.
https://magick.codeplex.com/wikipage?title=Convert%20image
There are lots of NuGet package are available also. Following is a one of them.
So what are we waiting for it’s time to create console application and adding a NuGet package.
I have added NuGet like below from package manager console.
For this example I have downloaded some sample PSD file from internet and need to convert that into .png file. Following is a code for that.
using ImageMagick; namespace PSDtoImage { class Program { static void Main(string[] args) { using (MagickImage image = new MagickImage("Flat Color Abstract City Background.psd")) { image.Write("Flat Color Abstract City Background.png"); } } } }Now once you run this console application. It will convert your PSD file into .png file. Here in constructor you need to supply path of that image file.
That’s it. Hope you like it. Stay tuned for more!!
Nice and Useful post.
ReplyDeleteThanks you for post.
ReplyDeleteYou're welcome
Deletebut if psd have alpha channel then it shows problem ,if you have any idea how to overcome it ,plz let me know
ReplyDelete