适用于 Java 的 Aspose.PSD 是一款易于使用的 Adobe Photoshop 文件格式操作 API。它可以轻松加载和读取 PSD、PSB 和 AI 文件,使 Java 开发人员无需安装 Adobe Photoshop 即可执行更新图层属性、添加水印、压缩、旋转、缩放或将一种文件格式呈现为另一种文件格式等操作。JPEG、TIFF、GIF、PNG、BMP、JPEG2000 等图像格式,只需几行代码即可轻松打开和添加为图层。PSD、PSB 和 AI 文件可以导出为列出的格式,也可以导出为 PDF 格式
Photoshop Java API 高级
从图像分区资源中提取数据
提取层级创建日期和时间
纸张颜色突出显示
将 PSD 文件转换为光栅图像
Aspose.PSD for Java 库支持将 PSD 文件转换为任何支持的光栅图像,只需几行代码即可。
将 PSD 转换为 BMP、GIF 和 JPEG-Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String destName = dataDir + "output"; | |
// load an existing document | |
Image image = Image.load(dataDir + "sample.psd"); | |
image.save(destName + ".bmp", new BmpOptions()); | |
image.save(destName + ".gif", new GifOptions()); | |
image.save(destName + ".jpeg", new JpegOptions()); |
轻松操作 Photoshop 图层
PSD 图层操作(例如合并图层、更新图层上的文本、设置效果或将图层导出为图像)是 API 提供的少量操作功能。此外,它可以检测扁平的PSD文档以及创建缩略图。
随时随地裁剪、旋转和调整图像大小
只需几行代码即可实现任何图像处理功能,例如翻转、裁剪、旋转和调整图像大小,例如,下面的代码片段可以旋转图像。
旋转图像-Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String destName = dataDir + "output.jpg"; | |
// Load an existing image into an instance of RasterImage class | |
Image image = Image.load(dataDir + "sample.psd"); | |
image.rotateFlip(RotateFlipType.Rotate270FlipNone); | |
image.save(destName, new JpegOptions()); |
此外,API 还提供不同的成像滤镜,例如调整光栅图像的对比度、亮度或伽玛、图像的抖动或模糊,以及最著名的滤镜,包括高斯维纳、中位数、布拉德利阈值和运动维纳。