Use kirby build im image optimize
schnti opened this issue · 4 comments
Is it possible to use the Kirby built-in image optimizer and to set a standard quality?
$page->image()->crop(xxx, xxx, 70);
ImageKit replaces Kirby’s synchronous image API with an asynchronous one. Basically, all it delays thumbnail generation until those resized images are requested by the browser. You can use all API methods like you would normally do in your templates. Only methods than cannot be handled asynchronously, like getting the filesize of a thumbnail file will cause synchronous creation of thumbnails. Kirby itself does not come with an image optimizer, but ImageKit requests your quality settings.
Does this answer your questions?
@schnti Did I answer your question? If so, please respond to my last answer so I can close the issue.
Yes, partly. Maybe the question also belongs to the imageset repository. I'm still looking for the possibility (without 3rd-party module like "mozjpeg", "jpegtran" etc.) to reduce the image data size with $image->imageset('200,400,600');
. Such as the $quality
property of the Kirby crop()
method.
You can set it globally:
c::set('thumbs.quality', 40);