A 106 kilobyte color profile for a 3 kilobyte image file
bbot.org
bbot.org
"This is not exactly an unknown problem. Google constantly harps on optimizing images, but Tumblr blindly reuses images that its users hand it. This makes me sad."
There are tons of valid uses for the color profile and other metadata in PNG files. Generally, I don't want services dicking with this stuff (in some cases I don't care, but I don't want the service to decide when I do or don't because it is bound to decide wrong some of the time, so they should just leave my data alone).
Onus should be on the content developer to save the image in a proper format and strip all metadata that isn't required. I don't want services I use stripping this stuff willy-nilly. Perhaps I want accurate color profile data in my PNGs so my tumblr followers can make accurate prints. Perhaps I want geolocation EXIF data in there because my blog is read by people who want to see this data, etc.
tl;dr -- Don't listen to this guy, Tumblr (or anyone else). He makes the classic mistake of "because something isn't important to me, it has no use".
Compromise: tumblr receives the image, compresses it, and shows the result to the user saying "how does it look?", as well as a disclosure triangle to show the list of optimizations it made, noting that if the picture looks wrong, to click it. When that disclosure triangle opens, it also offers a button saying something to the effect of "use what I uploaded, damn it!"
The vast majority who don't care click right through, those who do have a simple interface to see exactly what's going on with their image, and X thousands of pages can load quicker and save millions of people's bandwidth (and tumblr a bunch of money). Mobile users don't waste money on useless data and their images load much faster.
In any event, tumblr already resizes all large images to a maximum of 1280 pixels on either axis. If you were very concerned with maintaining images in their original state, this would be driving you up a wall. Good thing it's trivially easy to use alternative image hosting sites, like flickr or photobucket, on tumblr.
You could argue that small thumbnails don't matter. I would agree for small sizes, but as the size increases, it becomes important to preserve the ICC profile data. With bandwidth having become cheap, and processing power having become abundant, these days it's often appropriate to downscale images in the browser; so instead of storing thumbnail as 40x40, 60x60, 100x100 etc. depending on the use cases, just store a flexible version (say, 150x150) and let the browser scale. At that resolution, I would keep the ICC data.
What is a sane solution for users without clue? Does the website just need a good PNG optimizer and hope nothing breaks too bad, and if it does it's only an image?
For ultimate optimization do pngout, then optipng, then advpng - in that order! Each one sometimes reduces it even more than the one before, but only if you run them in that order.
The real question is why throw in the whole 100K including the color space and all, when only a gamma value would suffice?
'Stupid' programs like the gimp would deliver images that looked ok because they followed the hippocratic oath: first do no harm.
This is similar to -resize, except it is optimized for speed and any image profile, other than a color profile, is removed to reduce the thumbnail size. To strip the color profiles as well, add -strip just before of after this option.
http://www.imagemagick.org/script/command-line-options.php#t...
1) For small images, the table is bigger than the raw image itself, as this article amply demonstrated.
2) For poor quality images, colour quantisation does not save anything.
3) Good quality images with subtle colours are degraded by it.
In the example in the article, the embedded profile does nothing at all, because the default for the web is already sRGB. If your image, on the other hand, is in some other color space, such as Adobe98, the embedded profile allow the image to be displayed correctly in modern broswers. Without that profile, the colors will be wrong. Of course, in older browsers, the colors will be wrong regardless of the embedded profile, because most older browsers do not support color management. That is why, for display on the web, images should already be converted to sRGB. Most photo sites do this automatically.
One can use this sRGB color profile and jam it full of 'complex color information' and know that most sites won't do much with it. Instead, I'd bunch in there maybe 3-4 MB of information (or under size cap) and link the hell out of it.
Who'd expect an avatar image to DOS a site?
26.media.tumblr.com is an Akamai server, and I suspect it takes more than large files to bring them down.
Yes, you can wreak all sorts of havoc doing this, but I doubt you can actually take down Tumblr in any meaningful way, so it's not really a DOS attack.