JPEG compression library for PHP

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
Elephant23
New php-forum User
New php-forum User
Posts: 7
Joined: Sat Sep 10, 2016 5:12 pm

Mon Sep 12, 2016 6:28 pm

So for .pngs, I used a library called pngquant (also used by TinyPNG, Compressor, Kraken, etc.). I was wondering if there is a good JPEG compression library out there, similar to TinyJPEG.com or JPEGMini.com, since they are able to compress JPEGS without a noticeable difference somehow. I get the feeling that they are using a free library, like pngquant, but I can't seem to find any libraries for php that does a good job of compressing.

Obviously I could use the built in imagejpeg function in GD and imagemagick, but somehow when I set the compression to 75 or 85, the images frequently become very blurry and even larger in size than images that are compressed using TinyJPEG or JPEGMini. I'd like to be able to use a good library, so I can create an automated script to compress my JPEGs, like I do with my PNGs.
Last edited by Elephant23 on Tue Sep 13, 2016 2:58 am, edited 1 time in total.

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Mon Sep 12, 2016 10:53 pm

Have you tried http://php.net/IMagick? Not something I've tried, but may be worth a try.

User avatar
Elephant23
New php-forum User
New php-forum User
Posts: 7
Joined: Sat Sep 10, 2016 5:12 pm

Tue Sep 13, 2016 2:58 am

Hi, yes I did try it. It looks better than GD, but compresses it less. Thanks anyway.

Post Reply