Skip to content

Useful documentation update for WebP writer ? - PHP 8.1 GD supports lossless WebP with IMG_WEBP_LOSSLESS as quality option #488

@atti-dall-atto

Description

@atti-dall-atto

Some space efficiency to be gained by using IMG_WEBP_LOSSLESS (101) instead of [-1,100]
https://php.watch/versions/8.1/gd-webp-lossless

e.g.

$writer = new WebPWriter();
[]
$webp_quality = [ "quality" => IMG_WEBP_LOSSLESS] ;
$result = $writer->write($qrCode, $logo, $label, $webp_quality);

Still nowhere near as good as some WebP lossless compressors can go; I managed to compress the GD-produced .webp from 2.48KB to 1.63KB with IrfanView 4.72 on default lossless settings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions