nwtn/php-respimg
nwtn/php-respimg is a PHP library for responsive image handling: generate resized image variants, build srcset and sizes markup, and serve appropriately sized images across devices with simple configuration for PHP applications.
php-respimg is a direct lever on Core Web Vitals (LCP, CLS) and mobile performance: it generates correctly-sized, compressed image variants and emits srcset/sizes markup so browsers download only what fits the viewport. If speed is on the roadmap, this is a concrete way to ship it rather than leaving responsive images to each team's improvisation.Consider it when:
jpegoptim, pngquant, cwebp. This package orchestrates those binaries; without them it produces little. Note the technical assessment's finding that it also wraps a Node.js CLI, meaning your worker image inherits a Node runtime too.Look elsewhere when:
spatie/laravel-medialibrary or intervention/image v3 for an actively supported, Laravel-idiomatic path — or spatie/image-optimizer if you only need the compression step.To executives: Images are usually the heaviest asset on the page, and page speed drives conversion, SEO, and bounce rate. This package is a low-cost way to standardize image sizing and compression across the product instead of relying on each team to get it right — a cheap, focused win on performance, and a concrete baseline to compare against paid image-CDN services before we commit budget. The honest caveat: it is an unmaintained open-source component, so the framing is "adopt and own a thin internal wrapper," not "install a dependency." That means a small, one-time engineering investment (about one engineer-week) in exchange for a reusable asset — and a clean seam to swap in a maintained library or hosted service later without touching call sites.
To engineering: This is a workflow layer that shells out to native image tooling (ImageMagick plus optimizers, and a Node CLI underneath), producing responsive derivatives and the markup to serve them. It is not a dynamic transform service and it is not maintained upstream. Treat it as vendored source: pin the version, wrap it behind an internal ImageTransformer contract, run it only in a dedicated queue-worker image with the binaries baked in, never synchronously in the request path, and add tests and a manifest for idempotency. Document prerequisites (Node + ImageMagick + delegates) in the deploy image and treat filename/path handling as a security boundary. Recommended path: a time-boxed 2–3 day spike on production PHP/Laravel to validate PHP 8 compatibility, output quality, throughput, and memory — go/no-go against a fallback of spatie/image (offline derivatives) or a managed/imgproxy service. Either fallback is cheaper than maintaining a Node runtime for a package with zero dependents.
How can I help you explore Laravel packages today?