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

Batch Process images to WebP

Contributor ,
Sep 23, 2023 Sep 23, 2023

Copy link to clipboard

Copied

How can I batch process hundreds of files to Webp format? I have been using PS for decades, and there is no native way that I can see of batch exporting images as Webp files.

 

I can do this in Lightroonas jpegs, but they are too large. Is there any way of batch converting 400 jpeg files to webp?

 

I tried batch processing for the first time after creating a "Save as Copy" script, but it made me go through each step manually and did not save time. Any thoughts on this matter would be greatly appreciated.  

TOPICS
Actions and scripting , macOS

Views

4.4K

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 ,
Sep 23, 2023 Sep 23, 2023

Copy link to clipboard

Copied

Creating an action and using the batch command is the "standard native way", perhaps your action was set to "step by step" and not "accelerated" playback.

 

Anyway, I wrote a script for this:

 

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
Contributor ,
Sep 23, 2023 Sep 23, 2023

Copy link to clipboard

Copied

Thank you for your generous response, Stephen. Looking at it now.

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
Contributor ,
Sep 23, 2023 Sep 23, 2023

Copy link to clipboard

Copied

OK, I did as you instructed:

 

Copied code into Mac text file set to txt and not rich text. 

Changed .txt extension to .jsx extension

I placed it into Adobe Photoshop 2024/Presets/Scripts

Tried to load the script because it does not show up in the image processor script menu.

But when I tried to load the script, it became a dead end. See examples. 

 

For some context, I know nothing about scripting or batch commands. I just need to get bunch of images into Webp format for my website.

 

Any thoughts?

 

 

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
Community Expert ,
Sep 23, 2023 Sep 23, 2023

Copy link to clipboard

Copied

The script is correctly loaded, your screenshot shows that you named it as WebP_Script. It isn't meant to be visible under Image Processor. There should be no need to browse manually.

 

The input folder that you select must contain supported file types (PSD, TIFF, JPEG etc) for saving as WebP to the selected output folder. What file extensions are in the input folder?

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
Contributor ,
Sep 24, 2023 Sep 24, 2023

Copy link to clipboard

Copied

Please accept my gratitude, Stephen. This was of tremendous help to me, and if you lived in LA, I would buy you beer.

I have one last question. If I open the script and change the following two code lines  from 75 to 100, will it save at 100% ?

// Save as a copy and close
saveWebP("compressionLossy", 75, true, true, true, true);
activeDocument.close(SaveOptions.DONOTSAVECHANGES);

 

// Save as a copy and close
saveWebP("compressionLossy", 75, true, true, true, true);
activeDocument.close(SaveOptions.DONOTSAVECHANGES);

 

 

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
Community Expert ,
Sep 24, 2023 Sep 24, 2023

Copy link to clipboard

Copied

Changing from 75% lossy to 100% lossy, yes – not lossless.

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
Community Beginner ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

Hello, Stephen. It is very kind from you to create this kinda thing to help everyone around.

I had the same problem that Sanpanza showed, but I cannot find what is next to do to make it work. A bit of help here?

Thanks 

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
Community Expert ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

@ianamalod – the error screenshot has the clue "rtf"...

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

Text Editor Applications: Only paste the source code into plain text editors, not rich text or word processing apps. Common free or commercial plain text editors suitable for code saving include –

 

Mac: Apple TextEdit (ensure that the Format menu is set to Plain Text mode, not Rich Text mode), BBEdit

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
Community Beginner ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

Hey! thank you for your quick response 🙂 Yes, I read your doc. I used apple text edit, and saved as txt, then renamed it and changed the extension to jsx. Would you mind telling me what could've gone wrong? Thanks again!

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
Community Expert ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

quote

Hey! thank you for your quick response 🙂 Yes, I read your doc. I used apple text edit, and saved as txt, then renamed it and changed the extension to jsx. Would you mind telling me what could've gone wrong? Thanks again!


By @ianamalod

 

It's all in my previous reply, i.e.:

 

Mac: Apple TextEdit (ensure that the Format menu is set to Plain Text mode, not Rich Text mode), BBEdit

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
Community Beginner ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

omg! it worked! very much thanks!!!!!!! plain text was the thing. Have a very nice rest of the week!!! Made my day!

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
Community Expert ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

On the Mac, I advise using BBEdit or a dedicated scripting IDE tool (not AppleScript Editor for ExtendScript JavaScript) to avoid such issues and to take advantage of more powerful text editing features. Granted this may be considered overkill by those only wishing to save code without editing it.

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 ,
Apr 09, 2024 Apr 09, 2024

Copy link to clipboard

Copied

LATEST

BBEdit has a free mode and is arguably the best text editor available on any platform. I highly recommend it to any Mac user.

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
New Here ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

Hi Stephen, thanks so much for this script. Super helpful. If I wanted to the webp files to save without exif, xmp data, and ps data where would I edit the code?

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
Contributor ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

First, I exported my RAW images fas JPEGs from LightRoom, where I excluded EXIF, XMP, and metadata. Then, from those jpegs, I used Stephan's PS script to export the JPEGs as WebP files. Worked like a charm.

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
Community Expert ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

quote

First, I exported my RAW images fas JPEGs from LightRoom, where I excluded EXIF, XMP, and metadata. Then, from those jpegs, I used Stephan's PS script to export the JPEGs as WebP files. Worked like a charm.


By @Sanpanza

 

That obviously works, but I personally would save into a lossless compression and file format rather than JPEG, considering that the WebP is going to apply further lossy compression again.

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
Contributor ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

So you export directly from Tiff or PSD formats?

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
Community Expert ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

quote

So you export directly from Tiff or PSD formats?


By @Sanpanza

 

That would be better than as an intermediate format than using JPEG format (as long as TIFF doesn't include lossy JPEG compression, LZW and ZIP are OK as they are lossless).

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
Contributor ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

Thanks again, Stephen!!!

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
Community Expert ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

@Sanpanza – I could write a version of the script to save open documents in Photoshop, that way you don't have to save raw file renders to an intermediate format first.

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
Community Expert ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

quote

Hi Stephen, thanks so much for this script. Super helpful. If I wanted to the webp files to save without exif, xmp data, and ps data where would I edit the code?


By @bovinejoni

 

Change the first 3 values of true to false in both function calls as per this annotated screenshot of the code:

 

webp.png

 

Let me know how you go, good luck!

 

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