thephpleague / glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.
http://glide.thephpleague.com
MIT License
2.55k stars 198 forks source link

PNG filesize is 10 times photoshop #324

Open stuartcusackie opened 3 years ago

stuartcusackie commented 3 years ago

Hey, I was hoping to use webp for everything but webp creates blurry artefacts when using clipart style imagery.

So instead, I am allowing users to use PNG in some cases to keep the clipart sharp. Unfortunately an 40kb png exported from photoshop (17kb when run through tinypng.com) becomes 400kb when using glide & GD.

Photoshop (45.4 KB): full-width-purple-leaf-detail

tinypng.com (17.5 KB): full-width-purple-leaf-detail

Glide / GD WebP (11 KB) - I can't share webp on github but you will see the artefacts here: https://pasteboard.co/K40uMoc.webp

Glide / GD PNG (404 KB) 75106466a5f2e930af28713a6d4304d6 (1)

Any ideas?

stuartcusackie commented 3 years ago

Found the problem...

I was upscaling this particular image from 1100px to 1200px wide, and for some reason that massively increased the PNG size.

Still seems like a bug but I can using 'fit' => 'max' to avoid it.