$filePath = public_path('img/testImg.png');
dd(
\Illuminate\Support\Number::fileSize(
bytes: filesize($filePath),
precision: 3,
),
\Spatie\Image\Image::load($filePath)
->optimize()
->save()
,
\Illuminate\Support\Number::fileSize(
bytes: filesize($filePath),
precision: 3,
),
);
Shouldn't the image be lighter after optimising it?