8 ms·
The Tiniest GIF Ever
- bowmessage 14y agoI love these 'protocol-teardown' posts. They really bring back the obsession over the details which has been disregarded more and more as technology progresses. They're refreshing. :)
- bediger4000 14y agoI was thinking I'd write the same thing: "I love these 'smallest X' posts". I was thinking of the Muppetlabs "smallest ELF file" article, in particular, and Russ Cox's Zip file that decodes to a zip file (turtles all the way down). But won't there always exist a few people who just happen to have a talent or obssesion for the details? What name do we give those people? The word "hacker" is taken, and has a more impish, generalist connotation. "Engineer" has way too formal baggage associated. We need another word that means about the same thing as "docent", I reckon.
- jackalope 14y agoI agree. I'm always amazed when a compression protocol omits a "do nothing" option, or doesn't use that as its base reference, progressively moving away from it as it makes sacrifices to save space (computing overhead for lossless, quality for lossy). Is it even possible to encode a lossless MP3 of John Cage's 4′33″?
- djdfjhgf 14y agoJohn Cage's famous piece is not simply silence, it's the performance of silence.
- lmm 14y agoA particular performance of it, probably not. The space of possible lossless MP3s is quite tiny and I suspect consists of pure or close to pure tones, not the more complex spectra you get for the coughs and page turning you usually hear is 4'33".
- kevinconroy 14y agoGreat write up and +1 kudos to author for diving into the details. For the mere mortals out there looking to make their GIF, JPEG, and PNG images smaller (and websites faster), I highly recommend ImageOptim (http://imageoptim.com/ http://imageoptim.com/). This Mac-only tool combines all of the libraries below to compress your images down to the (nearly if not the) smallest, cross-system compatible size. If you're Mac based, try this: * ImageOptim http://imageoptim.com/ http://imageoptim.com/ If you're Linux based, try these: * PNGOut - http://www.advsys.net/ken/util/pngout.htm http://www.advsys.net/ken/util/pngout.htm * advpng - http://advancemame.sourceforge.net/doc-advpng.html http://advancemame.sourceforge.net/doc-advpng.html * pngcrush - http://pmt.sourceforge.net/pngcrush/ http://pmt.sourceforge.net/pngcrush/ * optipng - http://optipng.sourceforge.net/ http://optipng.sourceforge.net/ * jpegoptim - http://www.kokkonen.net/tjko/projects.html http://www.kokkonen.net/tjko/projects.html * gifsicle - http://www.lcdf.org/gifsicle/ http://www.lcdf.org/gifsicle/
- Inversechi 14y agoJust to add... for PNG optimisations on Windows. * PNGGauntlet - http://pnggauntlet.com/ http://pnggauntlet.com/ - Combines PNGOUT, OptiPNG, and DeflOpt.
- j_s 14y agoIf you're desperate to save space (or creating thumbnails), Windows/C# devs can lossily cut down PNGs to 256 color/8-bit using nQuant http://nquant.codeplex.com/ http://nquant.codeplex.com/ Matt Wrock documented the creation of the tool, including details on the approaches taken by tools like OptiPNG: http://www.mattwrock.com/post/2011/09/05/Convert-32-bit-PNGs-to-high-quality-8-bit-PNGs-with-C.aspx http://www.mattwrock.com/post/2011/09/05/Convert-32-bit-PNGs...
- deleted 14y ago[deleted]
- molf 14y agoWorth mentioning as well is TinyPNG - http://tinypng.org/ http://tinypng.org/, a free web service that uses lossy compression to shrink PNG images.
- mrspeaker 14y ago"Opening this image in Firefox at various different times, it has show up as shades of blue, green and brown"... That seems like odd behavior - does anyone know why this would be the case? Is it different stack values at the time?
- TazeTSchnitzel 14y agoPossibly Firefox doesn't clear the memory used to draw the image, assuming all will be filled. So different stack or heap values. It could also be re-using a drawing surface of some sort.
- fooyc 14y agoSeems like it could lead to information disclosure
- jtheory 14y agoI don't think that's it -- I'm not sure where I saw this, but I believe it's because if there's no global color table in the image, the spec says the displaying software should supply one... but there's no standard color table, so Firefox substitutes the color table from the last image it displayed. With asynch loading that can vary. If that's not right, maybe it's supplying a color table randomly-generated on the fly, but I doubt it's just random memory -- can any random bytes really make up a valid color table? If it were random memory I'd expect crashes or errors, not varying colors.
- xtdx 14y agoAll a color table is is a series of integers. Any random byte, or two, or four, is a valid integer.
- TazeTSchnitzel 14y agoHave you ever done any C programming? malloc() returns a pointer to an allocated block, but it isn't zeroed for you, so if you don't clear it yourself you may end up with random data. Same with uninitialised variables in C.
- elsamuko 14y agoIf anyone is interested, I did the same with TIFF: http://news.ycombinator.com/item?id=3773355 http://news.ycombinator.com/item?id=3773355 The peculiarity in this example is, that the image's content is the whole tiff itself.
- barredo 14y agoThis would be/is useful for tracking purposes if/when a real gif is necessary
- SageRaven 14y agoReminded me of the tiniest "Hello, world" ELF binary: http://timelessname.com/elfbin http://timelessname.com/elfbin I love posts like this.
- deleted 14y ago[deleted]
- rorrr 14y agoAnd it most likely makes no difference at all, because everything is wrapped into packets of a fixed size, much larger than 43 bytes.
- Zash 14y agoPretty small SVG image: <svg xmlns="http://www.w3.org/2000/svg"/>
- n0mad01 14y agoi just wonder that nobody mentioned http://www.smushit.com/ysmush.it/ http://www.smushit.com/ysmush.it/ yet.
- jacobr 14y agoThis can actually be useful if you want to make sure your interface works with images turned off. Some people, especially mobile users concerned with bandwidth, might have images turned off but CSS turned on. I had icons for some buttons, sprited and set as CSS backgrounds. Inside the same element I put an img tag with a minimal gif and an alt text with a fallback (a text label, or a single unicode character). The invisible image would be shown for users images, and the alt text for users without images.
- antirez 14y agoRelated: every programmer should take a look at LZW, the GIF compression algorithm, it is one of this "damn cool algorithms" out there, really simple, beautiful, and powerful.
- iso-8859-1 14y agoWhy not just use HTTP 204 No Content?