
TinyPNG launches API to automate PNG compression - molf
https://tinypng.com/developers
======
kken
Is this a viable business idea? E.g. providing a service online that requires
a limited amount of processing time and could be packaged in a fairly small
program when provided for offline processing?

To the vendor this obviously provides more control. But is it worth it for the
client?

Personally, I'd be very reluctant to transfer anything that could be done
locally by a small command line tool online.

~~~
molf
I'm one of the creators and I can tell you we don't know either. We're a web
development agency and this is a side project that got more popular than we
imagined. After we launched we got a massive amount of requests for licenses
or API subscriptions, so we decided to give it a go and see if we can at least
cover the costs.

~~~
cbsmith
I have to admit this one is a bit of a head scratcher, but I get why it works
at least for now. You've essentially built a SaaS bug fix for a shrink wrap
product, which.. yeah.

~~~
sturgill
Back when I was slicing and dicing specs that had to be compatible with IE6, I
really wish I could have used TinyPNG. Preserves alpha transparency that works
in really crappy browsers, without resulting to weird CSS filter shenanigans.

But even today, I really enjoy the service. Not sure what I would pay for it,
but it is very convenient.

------
chromaton
My favorite technique for optimizing PNG files comes from Wikipedia's page on
preparing images to be used in Wikipedia:

[http://en.wikipedia.org/wiki/Wikipedia:Preparing_images_for_...](http://en.wikipedia.org/wiki/Wikipedia:Preparing_images_for_upload#PNG_tips)

------
thangalin
Assuming someone has installed curl and is running from the command line, what
advantages does this service have over _optipng_ or _pngcrush_?

~~~
molf
TinyPNG combines lossy and lossless compression algorithms. Optipng and
pngcrush are lossless only. The difference in file size can be huge.

~~~
cuu508
ok, what about pngquant? Seems to be doing about the same thing. I've been
using it in batch scripts for processing hundreds of PNGs, repeatedly, with
good results.

[http://pngquant.org/](http://pngquant.org/)

~~~
molf
Yes, pngquant is awesome. TinyPNG uses it internally and combines it with
other, lossless optimizations. We built TinyPNG for ease of use (no
configuration, no settings to mess around with) and to reach a wider audience.
Definitely use the tools you're most comfortable with!

------
sturgill
I'm a pretty big fan of TinyPNG. I was actually part of their beta invite for
the API and wrote up a quick Ruby gem(1) to automate the process (and to auto-
shrink PNGs on a Capistrano deploy). I haven't really messed around with it
much since then, but it was fun to write and the team at TinyPNG was very
accommodating.

Not sure what I think about their pricing structure, but I wish them the best.

1) [https://rubygems.org/gems/tiny_png](https://rubygems.org/gems/tiny_png)

------
tmikaeld
As other mentioned already, a free open source alternative would be pngquant.

Here is a free open source app for OS X that uses it.
[http://pngmini.com/](http://pngmini.com/)

~~~
masklinn
Works nicely when combined with "classical" PNG optimizers (PNGOut, Pngcrush,
AdvPNG). And the same author has a frontend for these (ImageOptim)

------
onli
I think I like that.

Normally, I compress my pngs with gimp (by indexing them). That works fine,
and as I do most of my screenshots as well with it, it is not too cumbersome.
But it's not perfect either.

The results of tinypng are a bit better. In my tests the images are almost the
same size, text becomes equally blurry, but the gradients are a bit better
preserved and the colors less distorted.

With the Api, i can build a small tool which compresses the image for me
without having to start gimp.

Like (beware, crappy code):

    
    
        #!/bin/bash
        API_KEY=""
        wget -O "${1/.png/_tiny.png}" $(curl --user api:$API_KEY --data-binary @"$1" https://api.tinypng.com/shrink | JSON.sh | egrep '\["output","url"\]' | sed -e 's# [.*\]\t*##' -e 's#"##g')
    

I won't become a paying customer though, 500 is perfectly fine for me, and I
still have gimp. But I can imagine professional CMS-systems (or wordpress
setups) including this in their workflow to automatically compress the .pngs
inserted by their authors, instead of having to find the best compression
method on their own (and rely on the server setup).

PS: If that assumption turns out to be true, it could be worthwhile to build a
wordpress plugin using the API to try to push that.

~~~
molf
You're correct, some people that have been approaching us had several
thousands of images to compress monthly from their web shop or CMS system.

We're offering the free plan for people (perhaps like you) that just want to
convert a couple of images whenever they deploy a site or build an app.

------
nyar
I use Pngyu (
[http://nukesaq88.github.io/Pngyu/](http://nukesaq88.github.io/Pngyu/)) and it
gives me the same compression as tinypng.

------
drakaal
I can't think of where you would use this. What platform is missing this
functionality but has a URLFetch/Curl/FOpen to use the API?

I would also think that if it was viable as a business someone would undercut
you quickly. I suspect that a free Google App Engine account would give the
API's to do this for a LOT of users at no cost to the host... Looks like I
could roll it on GAE and handle about 70k images a day on a free instance or
2M a month on the free instance...

------
jheriko
has anyone tested this and compared it with other tools?

i seem to have a lot of free tools that do a very good job of this...
especially when i add some thought to it. my own tests are basically
inconclusive - its does the same job as my choice of tools up-to the point of
being clever with colour depth and accepting a little loss, or things like
knowing its a normal map so the blue channel can be binned...

/me waits for key to test thoroughly

hmm. looks like it is actually lossy. :/

------
gdc
We're trying to determine if this is a joke. Is this something that is real?

~~~
coin
Why wouldn't it be real?

------
Vektorweg
Nice idea. But maybe you should do this with webp.

------
_sabe_
This is perverted.

------
ginko
Something like this should just be released as an open source lib.

~~~
sukuriant
Why? It's the developer's choice to sell it or give it away for free.

They wrote something, they noticed a lot of uptake and now want to see if they
can monetize this. I don't see a problem here.

~~~
_sabe_
[http://devnull-as-a-service.com/home/](http://devnull-as-a-service.com/home/)

