A
A
AlpineMilk2020-07-03 21:13:14
PHP
AlpineMilk, 2020-07-03 21:13:14

How to reduce image weight as much as possible?

Hello! What is the best way to reduce the size of the image with a minimum quality of about 70.
For example png. I tried to change the format to webp, I got 100 from 200kb, but if the original image, for example, has a weight of 70kb, then I get about 60kb. Also, if you resize the image (reduce it), and then convert it to webp, then the size is even larger. I do as shown here https://www.php.net/manual/ru/function.imagecopyre...
only at the end I convert to webp.
Can you tell me how to reduce the size as much as possible? It is important for me that the image takes up little disk space.
For example, this site https://tinypng.com/compresses pictures very well, they have an api to use their service (only 500 a month for free will be expensive later), but in my web application, users will upload a lot of pictures. I ask for your help)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
neol, 2020-07-03
@neol

https://pngquant.org/php.html

T
Timur Khudiyev, 2020-07-04
@t_khudiyev

You can still reduce the number of colors, but in automatic mode, this setting can ruin the image. Try squoosh

P
Petr Ponomarev, 2020-07-05
@Petrdis

I use this one to reduce images on the fly image.intervention.io
For the best effect, I save png in jpg, reduce the quality to 70 and also reduce the image size to the desired one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question