Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Bulk conversions?

141 views
Skip to first unread message

Linda Cannon

unread,
Dec 6, 2024, 10:00:30 PM12/6/24
to WebP Discussion
Is there a way to convert all files in a directory at once? Sorry if I'm missing something simple. 

Linda

James Zern

unread,
Dec 9, 2024, 6:06:49 PM12/9/24
to webp-d...@webmproject.org
Hi,

On Fri, Dec 6, 2024 at 7:00 PM 'Linda Cannon' via WebP Discussion <webp-d...@webmproject.org> wrote:
Is there a way to convert all files in a directory at once? Sorry if I'm missing something simple. 


The tools in libwebp don't directly support this, but we have examples for both windows command prompt (or batch files) and unix shell:

This came up most recently in:

Linda Cannon

unread,
Dec 20, 2024, 1:42:06 PM12/20/24
to webp-d...@webmproject.org

 

Thanks for the tips. If I use either the mogrify command or the webp command in a Windows shell, how do I ensure that the right settings are used during the conversion? At the moment, I’m use the following command to convert. Doing this individually for each file is very tedious!

cwebp C:\Users\webimages\Connector_VP5.png -q 100 -lossless -o Connector_VP5.webp

 

Would something like this work?


mogrify -format webp -q 100 -lossless -o /path/to/folder/*

 

Windows shell:

 

> for /R . %I in (*.jpg) do ( cwebp.exe %I -q 100 -lossless -o %~fnI.webp )

 

 

--
You received this message because you are subscribed to a topic in the Google Groups "WebP Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/a/webmproject.org/d/topic/webp-discuss/GDe1QBcSivA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webp-discuss...@webmproject.org.
To view this discussion visit https://groups.google.com/a/webmproject.org/d/msgid/webp-discuss/CABWgkX%2BDLW4wtjt6meM274KAkX7AgCh5X69m%3D_fpmBacByzJBA%40mail.gmail.com.

James Zern

unread,
Dec 20, 2024, 5:01:13 PM12/20/24
to webp-d...@webmproject.org
On Fri, Dec 20, 2024 at 10:42 AM 'Linda Cannon' via WebP Discussion <webp-d...@webmproject.org> wrote:

 

Thanks for the tips. If I use either the mogrify command or the webp command in a Windows shell, how do I ensure that the right settings are used during the conversion? At the moment, I’m use the following command to convert. Doing this individually for each file is very tedious!

cwebp C:\Users\webimages\Connector_VP5.png -q 100 -lossless -o Connector_VP5.webp

 

Would something like this work?


mogrify -format webp -q 100 -lossless -o /path/to/folder/*


Close, but mogrify (ImageMagick) uses -quality, setting that to 100 will use lossless mode for webp. You can try the following if the current directory holds the image files you want to convert:
`mogrify -format webp -quality 100 -path output-folder *`
 

 

Windows shell:

 

> for /R . %I in (*.jpg) do ( cwebp.exe %I -q 100 -lossless -o %~fnI.webp )


This should work, though it looks like you have a png in your example command, so you'll want to update *.jpg to *.png.

Linda Cannon

unread,
Dec 20, 2024, 8:40:18 PM12/20/24
to webp-d...@webmproject.org

James, thanks! It worked!

 

 

From: 'James Zern' via WebP Discussion <webp-d...@webmproject.org>
Sent: Friday, December 20, 2024 2:01 PM
To: webp-d...@webmproject.org
Subject: Re: [EXTERNAL] Re: Bulk conversions?

 

--

You received this message because you are subscribed to a topic in the Google Groups "WebP Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/a/webmproject.org/d/topic/webp-discuss/GDe1QBcSivA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webp-discuss...@webmproject.org.

James Zern

unread,
Dec 21, 2024, 12:42:46 AM12/21/24
to webp-d...@webmproject.org
Glad to hear it. If you have any other questions please feel free to ask.

You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.
To view this discussion visit https://groups.google.com/a/webmproject.org/d/msgid/webp-discuss/SA6PR00MB23285AE1C674B53E90B402AD82002%40SA6PR00MB2328.namprd00.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages