There is a color difference in the picture

test-cp.zip (4.5 MB)

When using version 25.11 of Aspose.PSD 16.jar, color deviation occurs when the image is zoomed in for viewing. The attached files include the image comparison files with deviation and the original PSD files.

        PsdLoadOptions loadOptions = new PsdLoadOptions();
        loadOptions.setUseDiskForLoadEffectsResource(true); 
        loadOptions.setAllowWarpRepaint(true); 
        loadOptions.setLoadEffectsResource(true);
        Image rePic = Image.load(new ByteArrayInputStream(bytesPic));
        Image image = PsdImage.load(new ByteArrayInputStream(bytesPsd), loadOptions);
        if (!(image instanceof PsdImage psdImage)) {
            throw new RuntimeException("Loaded image is not PsdImage, but " + image.getClass());
        }
        for (Layer layer : psdImage.getLayers()) {
                if (layer instanceof SmartObjectLayer smartObj) {
                    if (layer.getName().contains(layerName)) {
                        int width = smartObj.getContentsBounds().getWidth();
                        int height = smartObj.getContentsBounds().getHeight();
                        rePic.resize(width, height, ResizeType.Mitchell);
                        smartObj.replaceContents(rePic);
                    }
                }
            }
         PngOptions options = new PngOptions();
         psdImage.save(outputStream, options);

@Luo.Lingfeng

You’re seeing a color shift when a PSD rendered with Aspose.PSD 25.11 (Java 16.jar) is zoomed in — the images in the attached test‑cp.zip differ from the original PSD [1].

To help us reproduce and investigate the issue, please provide:

  1. A short code snippet (around 10 lines) that loads the PSD and renders it at the zoom level where the deviation appears.
  2. The exact Java version and operating system you are using.
  3. If possible, a minimal PSD (or one of the files from the zip) that consistently shows the problem.

With that information we can try to replicate the behavior and determine the cause. In the meantime, you might try using a newer Aspose.PSD release (if available) to see whether the issue persists.

We’ll follow up in this thread once we have the reproduction details.

1 Like

It has been identified that the adjustGamma method is unimplemented. Are there any future plans to deliver this functionality?

    public void adjustGamma(float gammaRed, float gammaGreen, float gammaBlue) {
        throw new NotImplementedException();
    }

    public void adjustGamma(float gamma) {
        throw new NotImplementedException();
    }

@Luo.Lingfeng for the Aspose.PSD more preferred way to make gamma adjustment is the using of the Adjustment Layers:

import com.aspose.psd.Image;
import com.aspose.psd.fileformats.psd.PsdImage;
import com.aspose.psd.fileformats.psd.layers.adjustmentlayers.ExposureLayer;

// Load or create a PSD image
try (PsdImage psdImage = new PsdImage(300, 300)) {
    // Add Exposure Adjustment Layer
    ExposureLayer exposureLayer = psdImage.addExposureAdjustmentLayer();
    
    // Set exposure properties
    exposureLayer.setExposure(-0.03f);
    exposureLayer.setOffset(-0.0005f);
    exposureLayer.setGammaCorrection(1.85f);
    
    // Save the result
    psdImage.save("exposure_adjustment.psd");
}

@Luo.Lingfeng
Also, we have opened the following new ticket for the checking and the adding the support of AdjustGamma methods if it’s possible in the specific case, in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PSDNET-2732

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.