New image formats like WEP and MOZJPEG will be a boost to load on the web.  The majority of page load and render is usually attributed to unoptimized images, so these new formats will make both and desktop load times .  I17;ve taught you how to detect WEBP support but we’ve not explored how to create images; let’s have a look at how easy it is to , PNG, and even animated to WEBP.

Convert JPG and PNG to WEBP

My favorite open source image manipulation library, ImageMagick, doesn’t have the capability to convert images to WEBP out of the box — you’ll receive an ugly error if you don’t first install webp via a utility like homebrew:

brew install webp

Once webp is available, you can use ImageMagick to do the conversion:

convert logo.png logo.webp

In most cases the WEBP image, which is only available in Chrome at the time of publishing, will be significantly smaller than the original image.

Convert Animated GIF to WEBP

The webp library doesn’t have the capability to convert animated GIF images to WEBP.  You’ll need to download gif2webp from Google.  With gif2webp available, you can convert your animated GIF image to WEBP:

gif2webp animation.gif -o animation.webp

gif2webp provides numerous options for output modification like quality, multi-threading encoding, etc.

Imagine the boost in your site load time if you created and served WEBP images where they’re supported.  Faster sites means more conversions and better user experience.  Make it happen!

The post Convert JPG, PNG, and Animated GIF to WEBP appeared first on David Walsh Blog.

convert jpg, png, and animated gif to webp - ba vlny16 pc20dwalsh 20160705 - Convert JPG, PNG, and Animated GIF to WEBP

Source link


Please enter your comment!
Please enter your name here