Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
Created January 22, 2025 02:26
Show Gist options
  • Save conholdate-gists/802df8ead2431806dbc8bd2ea850e962 to your computer and use it in GitHub Desktop.
Save conholdate-gists/802df8ead2431806dbc8bd2ea850e962 to your computer and use it in GitHub Desktop.
Compress PSD in Java | Optimize PSD Photoshop File Size
// Load a PSD file
com.aspose.psd.Image image = com.aspose.psd.Image.load("sample.psd");
// Define the compression method
com.aspose.psd.imageoptions.PsdOptions options = new com.aspose.psd.imageoptions.PsdOptions();
options.setCompressionMethod(com.aspose.psd.fileformats.psd.CompressionMethod.Raw);
// Save compressed PSD image
image.save("compressed.psd", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment