Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created March 27, 2020 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/98c65d2d8b648bfa7db9d8213b61a31c to your computer and use it in GitHub Desktop.
Save aspose-com-gists/98c65d2d8b648bfa7db9d8213b61a31c to your computer and use it in GitHub Desktop.
// Load an existing PSD image as Image
using (PsdImage image = (PsdImage)Image.Load("Photoshop.psd"))
{
LayerGroup formats = (LayerGroup)image.Layers[1];
formats.Save("formats.png", new PngOptions());
Console.ReadKey();
}
// Load an existing PSD image as Image
using (Image image = Image.Load("Photoshop.psd"))
{
// Create an instance of BmpOptions class
BmpOptions options = new BmpOptions();
// Convert PSD to BMP
image.Save("PSD-to-BMP.bmp", options);
}
// Load an existing PSD image as Image
using (Image image = Image.Load("Photoshop.psd"))
{
// Create an instance of GifOptions class
GifOptions options = new GifOptions();
// Convert PSD to GIF
image.Save("PSD-to-GIF.gif", options);
}
// Load an existing PSD image as Image
using (Image image = Image.Load("Photoshop.psd"))
{
// Create an instance of Jpeg2000Options class
Jpeg2000Options options = new Jpeg2000Options();
// Convert PSD to JP2
image.Save("PSD-to-JP2.jp2", options);
}
// Load an existing PSD image as Image
using (Image image = Image.Load("Photoshop.psd"))
{
// Create an instance of JpegOptions class
JpegOptions jpegOptions = new JpegOptions();
jpegOptions.Quality = 100;
// Convert PSD to JPG
image.Save("PSD-to-JPG.jpeg", jpegOptions);
}
// Load an existing PSD image as Image
using (Image image = Image.Load("Photoshop.psd"))
{
// Create an instance of PdfOptions class
PdfOptions options = new PdfOptions();
// Convert PSD to PDF
image.Save("PSD-to-PDF.PDF", options);
}
// Load an existing PSD image as Image
using (Image image = Image.Load("Photoshop.psd"))
{
// Create an instance of PngOptions class
PngOptions pngOptions = new PngOptions();
// Convert PSD to PNG
image.Save("PSD-to-PNG.PNG", pngOptions);
}
// Load an existing PSD image as Image
using (Image image = Image.Load("Photoshop.psd"))
{
// Create an instance of TiffOptions class
TiffOptions options = new TiffOptions(FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Convert PSD to Tiff
image.Save("PSD-to-Tiff.tiff", options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment