Archived from the Transloadit support forum. Originally posted on July 4, 2014; details may be outdated, see our docs for current behavior. Original thread
Hi,
when running “so-crazy.png” trough the /image/optimize bot test on https://transloadit.com/docs/conversion-robots#reduce-image-file-sizes it returns the file without any file optimization. It still has a filesize of about 120 KB. But when I run the file several times trough http://tinypng.org I’m able to reduce the file size down to 32 KB without loosing quality! What is the problem here? There are several good and free implementations of libs that reduce png file sizes…
I just tested with that assembly and it trims down the size of the screenshot from 1.4mb to 175kb. That’s a factor 8 smaller, so I probably wouldn’t call the tool broken.
But obviously if you’re able to achieve an even bigger factor, that’s what we should at least be aiming for.
We’re currently using the optipng to do this. Have you tried multiple runs through our tool as well? If that’s better we have have to consider abstracting that away for you and run it multiple times ourselves.
If that doesn’t help we could investigate using a different tool such as http://pngquant.org/.
One final thing, maybe the tinypng trips metadata? We don’t do so by default as it’s considered bad internet citizienship (removing copyright of photographers and such should not be default behavior).
Since pngquant cannot preserve metadata, we have chosen that setting preserve_meta_data to false is mandatory. That’s so that accidental meta/copyright stripping (frowned upon by good internet citizens) is less likely to happen.
It’s still beta so there are no docs. You’ll be the first one to try it out so we’re also looking forward to your feedback! : )
I’m finally revisiting this issue. I’ve tried to reproduce your findings but so far I’m unable to. For instance, with the image attached, we get similar compression rates with pngquant turned on (tinypng goes from 198.0 KB to 69.3 KB - we to 73.2 KB). Those are rates I can live with for something that’s we offer as a sidedish : )
Can you maybe attach 1 image that performs really bad? I would love to add that to our test suite and then try some more options.
in the meanwhile I get the same results as you 3-8% less than tinypng - which is totally fine
I think my “bad” experience directly after you send me the first draft of pngquant resulted because of the API was not published at that time or whatever.
Ok excellent! I’ll start working on the docs & blogpost then so others can too benefit from this improvement. Just a thought, would you like to be featured in the blogpost with a link to your site and a nice quote, or not interested in that?
Some technical background how and why we use TL: (You can use this to cite us)
Yarnee is a tool to create collections of media that else would go lost in the feed based services like T, FB and Instagram. With Yarnee you can keep things together.
- We use TL to be able to develop very fast.
- We use it to compress, crop images and storing them (S3)
- We use the audio wave robot to visualize audio files
- We also use HTML to PNG robot, and the wave form generator to visualize audio files inside the App.
About the PNG compression request:
When a Yarn link is shared on FB we tell FB via Open Graph to display an interactive flash object. FB offers to display a nice preview image of the Open Graph content. We wanted to have a nice preview that indicates to the users what they can expect. So we have HTML website that displays 4 circles of the first 4 pages of Yarnee nicely formated with CSS. This is captured via the html/capture(?) robot and stored as PNG. To get FB to accept those images it was very important to reduce the file size of those created PNG so we use the new png compression to get nice FB previews
Any further questions? Feel free to ask.
You can quote me or another developer of the team with:
“Without TL we would not be able to focus on our core features in our iOS APP” or “TL helped us to develop Yarnee without thinking of image and video compression!”, or something similar.
There’s much more good material in your response. I’ve saved it in a case-study folder in our site. At a later point we want to design a few good ones, and you’ll definitely be among the first to hear from us then!