Convert PSD to PNG in C#

PSD (Photoshop Document) is the native file format for Adobe Photoshop, commonly used for creating logos, brochures, and various graphics. While designers can export Photoshop layers as PNG 이미지 directly within Adobe Photoshop, converting PSD files to PNG images programmatically can significantly streamline workflows and reduce manual intervention. In this article, we will explore how to convert a PSD to a PNG image in C# using the powerful Aspose.PSD for .NET API.

테이블 콘텐츠

C# PSD to PNG 변환기 API

To convert PSD files to PNG images, we will utilize the ASPOSE.PSD 및 .NET API. This robust .NET Plugin simplifies the manipulation of Adobe Photoshop file formats, enabling .NET applications to load and read both PSD and PSB files. With Aspose.PSD, you can easily update layer properties, add watermarks, rotate, scale, render, and convert PSD files, along with a variety of other 지원되는 파일 형식, 모든 것이 Adobe Photoshop을 필요로하지 않습니다.

The 이미지 class serves as the base class for all image types, while the psdimage에 대한 정보 class allows you to load, edit, and save PSD files. It includes the 저장(string, ImageOptionsBase) method to save the PSD in a specified file format and location. Additionally, the API provides the PsdLoad옵션 class for specifying load options and the PNG 옵션 class for defining PNG file format creation options.

You can either DLL 다운로드 of the API or install it via 나그네:

PM> Install-Package Aspose.PSD

PSD를 PNG로 변환하는 방법

PSD 파일을 PNG 형식으로 변환하는 것은 간단한 과정입니다.이 단계를 따르십시오.

  • PSD 로드 옵션을 정의합니다.
  • PSD 파일을 다운로드합니다.
  • PNG 저장 옵션을 지정합니다.
  • PSD를 PNG로 저장하십시오.

다음 섹션에서는 이러한 단계를 C# 코드로 번역하여 PSD 파일을 PNG 형식으로 수출합니다.

C#를 사용하여 PSD를 PNG로 변환

C#를 사용하여 PSD 파일을 PNG 이미지로 변환하려면 다음 단계를 따르십시오.

  • PsdLoadOptions 클래스의 예를 만드십시오.
  • Specify load options, such as ReadOnly모드.
  • Image 클래스를 사용하여 PSD 파일을 PsdImages로 업로드합니다.
  • PngOptions 클래스 개체를 시작합니다.
  • Specify PNG options, including 색상 타입, 진보적, and 압축 수준.
  • 출력 파일을 Save() 방법을 사용하여 저장합니다.

다음은 C#에서 PSD를 PNG로 변환하는 방법을 보여주는 코드 샘플입니다**:

Source PSD

Source PSD

Convert PSD to PNG using C#

Converted PNG

무료 임시 라이센스를 받으십시오.

You can 무료 임시 라이센스를 받으십시오. to try Aspose.PSD for .NET without any evaluation limitations.

결론

이 기사에서 우리는 어떻게 배웠는지 :

  • 기존 PSD 파일을 다운로드합니다.
  • PSD 로드 및 PNG 옵션을 지정합니다.
  • C#를 사용하여 PSD를 PNG로 저장합니다.

Beyond converting PSD to PNG in C#, you can discover more about ASPOSE.PSD 및 .NET by visiting the 문서화 and exploring various features supported by the API. If you have any questions or need assistance, feel free to reach out on our 무료 지원 포럼.

추가 자료

자신의 지식을 향상시키는 데 관심이있는 사람들을 위해, 탐험을 고려하십시오 :

  • .NET Core PSD to PNG Conversion Tutorial: .NET Core 컨솔 애플리케이션에서 이것을 구현하는 방법을 배우십시오.
  • High-Performance .NET PSD to PNG Conversion : 변환 프로세스를 최적화하는 기술.
  • Batch PSD to PNG Conversion in .NET Core : 한 번에 여러 파일을 효율적으로 변환합니다.
  • C# .NET 6 PSD to PNG API: 최신 기능 및 업그레이드를 찾아보세요.

Aspose의 .NET PSD to PNG Conversion Library, 당신은 높은 품질, 효율적인 변환을 달성 할 수 있는 동안 투명성을 유지하고 처리 레이어를 무조건. PSD-PNG 파일 컨버터를 찾고 있는 사람들을 위해,이 도서관은 훌륭한 선택입니다. 또한, 만약 당신이 Photoshop 사용자라면,당신은 응용 프로그램 내에서 직접 수출할 수 있습니다.

More in this category