마스킹 적용

레이어 마스크 지원

이 문서는 PSD 이미지의 마스크 레이어를 지원하는 방법을 보여줍니다. 그리고 그 이미지들을 저장합니다. 아래에 코드 스니펫이 제공되었습니다.

String dataDir = Utils.getDataDir(SupportOfLayerMask.class) + "PSD/";
// Export of the psd with complex mask
String sourceFileName = dataDir + "MaskComplex.psd";
String exportPath = dataDir + "MaskComplex.png";
try (PsdImage im = (PsdImage) Image.load(sourceFileName)) {
// Export to PNG
PngOptions saveOptions = new PngOptions();
saveOptions.setColorType(PngColorType.TruecolorWithAlpha);
im.save(exportPath, saveOptions);
}

클리핑 마스크 지원

이 문서는 Aspose.PSD를 사용하여 PSD 파일에서 클리핑 마스크를 지원하는 방법을 보여줍니다. 아래에 코드 스니펫이 제공되었습니다.

String dataDir = Utils.getDataDir(SupportOfClippingMask.class) + "PSD/";
// Exposure layer editing
// Export of the psd with complex clipping mask
String sourceFileName = dataDir + "ClippingMaskComplex.psd";
String exportPath = dataDir + "ClippingMaskComplex.png";
try (PsdImage im = (PsdImage) Image.load(sourceFileName)) {
// Export to PNG
PngOptions saveOptions = new PngOptions();
saveOptions.setColorType(PngColorType.TruecolorWithAlpha);
im.save(exportPath, saveOptions);
}