How To Convert WebP To GIF Image Format In PHP With Example?

How To Convert WebP To GIF Image Format In PHP With Example?

function yttags_webp2gif($src_file_path, $file_destination_path, $colors_count = 16)
{
    $image = imagecreatefromwebp($src_file_path);
    imagetruecolortopalette($image, false, $colors_count);
    $final_output = imagegif($image, $file_destination_path);
    if (false === $final_output) {
        return false;
    }
    imagedestroy($image);
    return $file_destination_path;
}
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments