rosell-dk/webp-convert
PHP library for converting JPEG, PNG and other images to WebP. It tries multiple converters (cwebp, vips, Imagick, GD, ffmpeg, cloud APIs) with automatic fallback, so conversions succeed even on limited hosts. Includes quality options, error handling and framework integrations.
cwebp, vips, Imagick, GD, ffmpeg, GraphicsMagick, and remote converters behind one API, you can ship the feature before knowing what binaries your hosting fleet exposes — and defer "which binary do we standardize on?" to a later, cheaper decision.exec() is disabled?" It falls back to GD/Imagick-based conversion or leaves originals untouched, which changes your deployment requirements doc.Adopt it when:
cwebp, or exec() disabled — and you need graceful degradation rather than a hard dependency on one binary.Look elsewhere when:
intervention/image or move to a service; this package converts, it doesn't do a full transform API.Accept headers and format selection better than PHP.sharp, squoosh, or spatie/image-optimizer in CI is a better fit.cwebp or Imagick everywhere — a thin wrapper may suffice, though this package still saves you the fallback maintenance.For executives: This is a free, MIT-licensed library that lets us serve WebP images without paying per-image fees or signing a CDN contract. Smaller images mean faster pages, better Core Web Vitals, improved SEO and mobile conversion, and lower bandwidth bills — the usual levers for e-commerce and content sites. Integration is small and reversible: no vendor lock-in, no procurement, and we can pilot it on one surface before committing.
For engineering: One composer require, PSR-friendly, actively maintained, MIT. It solves the genuinely annoying problem — you don't know which converter exists on each host, and exec() may be off — by trying cwebp, vips, Imagick, GD, ffmpeg, and remote fallbacks in order, and failing safe to the original image. We stop owning that detection matrix. Concerns to plan for: do conversions off the request path in a queue/job, monitor conversion-failure rates and output sizes, pin the version, and note it's effectively single-maintainer — so treat it as a swappable dependency behind our own small service class rather than calling it throughout the codebase.
For product/design: It enables "upload once, we serve optimized images" without asking users to change anything. Default quality (~80) is the knob that governs the fidelity/bandwidth tradeoff, and we should measure it against our own imagery rather than guessing.
How can I help you explore Laravel packages today?