How to reduce the convertion time of psd to jpg

Hi Supports,
I tried to convert psd to jpg with aspose.psd in my pc,but it cost more than 4000ms,
my pc hardware list:
cpu: i3-8100, 4cores, 4threads, base frequency 3.6GHZ
memory: 16GB
Which hardware should I upgrade if I want to reduce the convert time,CPU cores or CPU base frequency or memory

@smartlee could you please provide file which you described. The time of converting highly depends on the file. For example, Warp Transformation takes a long time. Processing of layer effects takes a long time.

And could you please additionaly describe, do you need to edit PSD file before converting or not?

@Dmitriy.Sorokin Hi,you can get the original psd file from this link .
And before convert,I need to replace the SmartObject with a picture,the picture you can get from this link,
even though exclude the edit step,it still cost more than 3000ms,
you can see my profiler screenshot below
1706679253496.png (41.0 KB)

@smartlee
Thank you. I can confirm that locally your case takes relatively close time. I’ve created task for investigation of this case to find possible ways to optimize it. Also, If you want to optimize perfromance with a hardware upgrade, I recommend improve performance of cores. The count of cores will help to process a larger number of files at the same time. RAM is quite enough for these types of files. But if the you will process file with a much larger picture resolution the RAM can be a bottleneck.

This half a year PSD Team will be focused on the optimization of product performance.

Could you please update url to picture that you want to use as a replacement on smart object. It seems there is the same url as on the source PSD File.

Also, it’ll help Aspose.Team to optimize this case if you provide code sample that you use.

sorry,I copyed same url,the correct picture file is link

@Dmitriy.Sorokin
please see my code sample below

  1. replace picture

         byte[] imageBytes = IOUtils.toByteArray(new URL(params.getImageUrl()));
         LinkDataSource contentsSource = layer.getContentsSource();
         contentsSource.setFileType(FilenameUtils.getExtension(params.getImageUrl()));
         layer.setContents(imageBytes);
         layer.updateModifiedContent();
    
  2. convert psd to image

    ImageOptionsBase outputOptions;
    if (“jpg”.equalsIgnoreCase(outputFormat)) {
    outputOptions = new JpegOptions();
    } else if (“png”.equalsIgnoreCase(outputFormat)) {
    outputOptions = new PngOptions();
    } else if (“psd”.equalsIgnoreCase(outputFormat)) {
    outputOptions = null;
    } else {
    throw new UnsupportedOperationException(String.format(“Unsupported output format: %s”, outputFormat));
    }
    String outputFile = new File(outputDir, UUID.randomUUID() + “.” + outputFormat).getAbsolutePath();

     if (outputOptions != null) {
         template.save(outputFile, outputOptions);
     } else {
         template.save(outputFile);
     }
    

@smartlee
I’ve updated the issue ticket.

I can’t get access to the file by this link. https://drive.google.com/file/d/1PaH4bJoDBdlzQ89RIqSewjjkseZ937N5/view?usp=sharing Maybe some access policies should be changed? Thank you.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PSDNET-1908

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.

@Dmitriy.Sorokin I’ve changed access policies ,You can access now

1 Like

I’ve downloaded it and attached to the issue.