The laravel-image-transform-url package offers a lightweight and expressive way to manipulate image URLs by appending transformation query parameters. The design behind this package is inspired by Cloudflare images, using an image URI to configure transformations for an image such as width, format, background, flipping, etc.:
http://localhost:8000/image-transform/width=250,quality=80,format=webp/foo/bar/example.jpg
This package was newly created—v0.4.0 at the time of writing—and it doesn't have all the features found in Cloudflare images. However, it provides an alternative, a self-hosted image proxy using Laravel and Intervention image for file manipulations. Also, you can provide image manipulation within your existing application to simplify your development setup and deployment for image manipulations.
This package offers some helpful features out of the box to improve performance, like storing processed images, caching, and more:
Main Features
- Use URL parameters to transform images on the fly
- Support for various transformations like resizing, compression, and format conversion
- Automatic caching of transformed images for faster loading times
- Easy integration with CDNs for even faster global delivery
- Support for rate limiting
- And more...
Check out the documentation on GitHub for more options and advanced usage.
You can install the package via Composer and publish the configuration to customize settings:
composer require ace-of-aces/laravel-image-transform-urlphp artisan vendor:publish --tag="image-transform-url-config"