PSD图像更换图像透明图像为白色背景

从PSD文件的图层更换图像,更换后透明图像的背景为白色
原图:
image.png (34.1 KB)
更换后的图:
image.png (32.9 KB)
代码:
SmartObjectLayer smartLayer = (SmartObjectLayer)psdImage.getLayers()[i]; smartLayer.replaceContents(imgPath);
smartLayer.updateModifiedContent();

如何处理能让二维码的背景在图像上为透明呢

psd文件加载代码:
Image image =Image.load(path);
PsdImage psdImage = (PsdImage) image;
psdImage.save(img_path_src,new PngOptions());
更换图像代码:
SmartObjectLayer smartLayer = (SmartObjectLayer)psdImage.getLayers()[i];
smartLayer.replaceContents(imgPath);
smartLayer.updateModifiedContent();

图像导出代码:
psdImage.save(img_path_replace,new PngOptions());

@junjun.pan
使用 ShapeLayer API 可以实现这一点。它将在 23.8 中发布,因此 Java 版本将在 9 月至 10 月准备就绪

我们已在内部问题跟踪系统中打开以下新票证,并将根据中提到的条款提供修复Free Support Policies.

Issue ID(s): PSDNET-1607

如果您需要优先支持,以及直接联系我们的付费支持管理团队,您可以获取 Paid Support Services

The issues you have found earlier (filed as PSDNET-1607) have been fixed in this update. This message was posted using Bugs notification tool by yaroslav.lisovskyi