Any easy way to convert png to webp on Mac?

For image conversion, I always use the Preview app. However, it seems there is no export option for webp image format. When I open the .png files from the Preview app, the supported format within the export menu are only limited to HEIC, JPG, JPEG-2000, OpenEXR, PDF and TIFF.


How can I bulk convert png to webp on my Mac? The png images are too big for website pages and Google webmaster guidelines recommend using webp for fast page loading speed.


Thanks

MacBook Pro (M3, 2023)

Posted on Sep 10, 2024 2:58 AM

Reply
16 replies

Sep 10, 2024 8:43 PM in response to Iceni331

cwebp is a command-line tool that is part of the WebP library. It is used for converting images from various formats (like PNG, JPEG, and TIFF) into the WebP format, which provides better compression without significantly compromising image quality. WebP is useful for reducing file sizes and it is very popular for web usage.


How to convert PNG to WebP on Mac:


If you don't have WebP tools installed on your Mac, you can easily install them using Homebrew:


brew install webp


In the Terminal, navigate to the folder containing your PNG files. Use the following command to convert a PNG file to WebP:


cwebp input.png -o output.webp


Replace input.png with the actual name of your PNG file and output.webp with the name you want for the WebP file.


By default, cwebp applies lossy compression. You can adjust the quality of the WebP file by adding the -q option (range 0-100, where 100 is the best quality):


cwebp -q 80 input.png -o output.webp


Let me know if you need more details on specific options or advanced usage!

Sep 10, 2024 8:50 PM in response to Iceni331

ImageMagick is a powerful, open-source software suite for converting, editing, and composing images. One of its widely used features is the ability to convert images between formats, including converting PNG to the WebP format.


Using ImageMagick's command-line tool, you can easily convert PNG images to WebP format on Mac with just a few commands. ImageMagick also allows you to adjust quality settings, control compression levels, and handle batch conversions efficiently. So it is a versatile tool for developers and designers looking to optimize images for the web. Whether you're working on a single image or need to process large batches, ImageMagick provides an effective solution for PNG to WebP conversion.


Code sample for bulk conversion:


for filename in *.jpg *.gif *.png
do
    new_filename="${filename%.*}.webp"
    echo "'$filename' -> '$new_filename'"
    magick "$filename" "$new_filename"
done

Sep 10, 2024 4:42 AM in response to Iceni331

There's nothing wrong with PNG. You just need to resize your images to better fit the context in your web pages.


Webp is a horrible format. Yes, it does have very good compression ratios. But its compression algorithm is very slow. You are exchanging data transfer time for page rendering time. It's much better to just use images that are appropriately sized.

Sep 10, 2024 11:47 PM in response to Iceni331

How to convert PNG to WebP on Mac using Preview (built-in tool):


  1. Open Your PNG: Just double-click your PNG file, and it should open in Preview.
  2. Export: Go to File > Export (not Save As). Here, you can choose different formats.
  3. Choose WebP: From the dropdown menu, select WebP. You can adjust the quality slider if you want (this can affect file size and quality).
  4. Save: Choose where to save it, hit Save, and you're done!


Sep 10, 2024 11:54 PM in response to Iceni331

If you're all in on the Microsoft ecosystem, you might want to check out Microsoft Paint on Windows for conversions, and while it won't help directly on your Mac, sharing resources or guides from Microsoft can make the process smoother. Microsoft Edge also supports viewing and converting images with the built-in tools, though it's primarily a browser.



Converting PNG to WebP on a Mac is pretty straightforward, and you have options depending on your comfort level with tech. I usually go with Preview for quick conversions, but if I need to batch convert a bunch of images, the command line option is powerful. Just be mindful of any privacy issues with online converters and keep an eye on formats and versions to avoid hiccups.

Sep 11, 2024 4:56 AM in response to Iceni331

Iceni331 wrote:

Page speed is an important ranking factor from Google and it recommends webp:

I'm pretty sure that an appropriately sized PNG file is going to be faster than any web image.


Google is one of the world's largest content delivery networks. Google has to pay for storage and outgoing data transfers. Webp makes both of those cheaper for Google. But it makes the local client rendering more costly and less energy efficient. It's a transfer of computational costs from the rich to the poor.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Any easy way to convert png to webp on Mac?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.