• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

How to "save as" a smaller size via .jsx scripting code in Photoshop?

Participant ,
Jul 04, 2023 Jul 04, 2023

Copy link to clipboard

Copied

When you bring up the "Save As" dialog box in Photoshop, it gives you the option to save the Photoshop document as a smaller file size. So let's say my original Photoshop file is 4000 x 4000 px. I can decide to save it as 25% the size, or as a 1000 x 1000 px JPEG.

 

Is there a way to get the same functional equivalent via the jpgSaveOptions in .jsx scripting code?

 

Presently here is my code for this section:

 

        var jpgSaveOptions = new JPEGSaveOptions();
        jpgSaveOptions.embedColorProfile = true;
        jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
        jpgSaveOptions.matte = MatteType.NONE;
        jpgSaveOptions.quality = 5;
 
Is there some additional option that can give you the same functional equivalent of reducing the final image size?
 
Also note that I could just resize the original Photoshop document itself. Since it contains a Smart Object, for whatever reason, I've found that when I batch-replace the Smart Objects with JPEGs at this smaller document size? It creates all kinds of weird image artifacts and distortions that you for some reason don't see when you FIRST save it at the full original size, then resize AFTER the fact by reducing the JPEG image. That's why I'm trying to get that same functional equivalent, but by condensing it into this one step vs. needing to do this in 2 steps via a second batch.
 
Thanks!
TOPICS
Actions and scripting , Windows

Views

205

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jul 04, 2023 Jul 04, 2023

Copy link to clipboard

Copied

quote

When you bring up the "Save As" dialog box in Photoshop, it gives you the option to save the Photoshop document as a smaller file size.

I fail to see that option in the Save As-dialog. 

Screenshot 2023-07-05 at 08.30.29.png

Could you elaborate and post screenshots to illustrate? 

 

 

quote
Also note that I could just resize the original Photoshop document itself. Since it contains a Smart Object, for whatever reason, I've found that when I batch-replace the Smart Objects with JPEGs at this smaller document size? It creates all kinds of weird image artifacts and distortions that you for some reason don't see when you FIRST save it at the full original size, then resize AFTER the fact by reducing the JPEG image. 

What is this supposed to describe?

If there was no Smart Object how would you replace the Smart Object’s content? 

What artefacts and distorstions? 

Pelase post meaningful screenshots including all pertinent Panels. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 05, 2023 Jul 05, 2023

Copy link to clipboard

Copied

LATEST

I meant Export As, not Save As.

 

Here's what I ended up doing: I just took the Photoshop Smart Object documents used in this workflow and downsized them to 1000x1000px (the final desired image size anyway). I then just applied 6/12 for the image quality settings to compress the image to get a smaller file size with a marginal visual quality reduction. I may have misremembered some earlier problems I was having with image size + distortions related to Smart Objects, because when testing the final JPEG images of the 1000x1000 vs the original 2000x2000 or 4000x4000, I saw no discernable differences in image quality.

 

Ended up modifying a few other parts of the script workflow as well, and it's almost 2x faster than the previous version.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2023 Jul 05, 2023

Copy link to clipboard

Copied

Are you thinking of one of the different ways to save a JPEG - not Save As ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines