9951 explained code solutions for 126 technologies


php-gdHow to convert jpg to webp


<?php

$im = imagecreatefromjpeg('image.jpg');
imagewebp($im, '/tmp/image.webp');ctrl + c
imagecreatefromjpeg

creates GD image object from given PNG image

imagewebp

saves given gd image in webp format to the specified path