Wouldn’t you like to switch?

Of course I’ve switched all my GIF images to PNG, since software patents make Baby Jesus cry, but I still have to dig through five access log entries for every hit on my main page (HTML, CSS (thanks, NN 4.x, for making me import it), plus three little images), and your browser and my server have to negotiate an HTTP connection to pass each file. But, thanks no doubt to my impugning his xmlrpc: URL scheme, Mark A. Hershberger points out that I could just be using a data: URL and putting the images inline, if you would just switch to a decent Gecko-based browser. If you are using Mozilla, Phoenix, Chimera, or another of the fine browsers based on Gecko, then:


is just the familiar white-on-orange XML image you’ve seen linked to thousands of RSS files (if you are using a disadvantaged browser like IE, it’s a broken image: too bad). But if you view source, you’ll see that rather than an <img> tag linking to another file, it’s just <img src=”data:image/png;base64, iVBORw0KGgo………………..” />, fully self-contained. Very cool. And with only 42881 hits from IE to 16083 from Mozilla so far this month, it’ll only be, um, a long time before I can switch to inline images.


Comment by Michael Z. #
2002-12-16 23:20:42

Yeah, but even if it’s tiny, some folks might appreciate not having to download it. And ISPs might cache it when your home page is updated.

I appreciate the desire for simplification, but it doesn’t seem to me that reducing the bandwith of a webmaster’s access logs by a few lines justifies adding the traffic to the Internet. You’re the person with GREP, and some of them might be the folks with Explorer 4.5 and a 32k modem.

Comment by Phil Ringnalda #
2002-12-17 00:03:35

Well, yeah, the access log was stretching a bit, since I don’t exactly browse it, and base64’s a bit bigger than png (though when the server gzips the page it’s probably a wash), so probably it’s only reasonable if you are displaying a whole lot of different tiny but important images which would be a pain for someone with images off to hover over to see a tooltip.

But it’s shiny!

Comment by stephan #
2002-12-17 00:43:53

Very cool. Because if IE would support this, server side image generation would be much much easier.

Comment by Mark A. Hershberger #
2002-12-17 07:08:11

The TCP and HTTP overhead for each new request means that embedding images in this way /will/ reduce your bandwidth. Too bad IE doesn’t support it.

Comment by Gerald #
2002-12-24 18:08:30

In case of a spider or a text browser the inline images would be superfluous traffic. As everybody has to fetch the complete page, it would not be possible to concentrate on the pure text. And what’s about caching of images, is it handled by this feature? This means caching of multiple instances on one page as well as caching over several pages. For instance a simple text-change would produce a complete new page, with the images inside. Doesn’t look optimal to me.
The size of the image part in base 64 would make this technique inefficient in case of greater images, and mod_gzip compression would not help very much, as the compression of compressed content should be very inefficient. Furthermore the distribution of error-free gzip-capable browsers (and trouble with proxies) are not absolutely convincing. But it is a cool feature I never heard before.
Kind regards and a MERRY CHRISTMAS from germany! Gerald

Comment by Gerald #
2002-12-25 17:12:31

Hi Phil, your xml-PNG is not very efficient. I have made some experiments and reduced its size from 1028 bytes to 283 bytes. In GIF format it would be even smaller, made it in 234 bytes. The loss in size correlates with a loss in colors – from original 51 colors they were reduced to 16 now. but imho there has been no loss in quality!

original PNG image

1028 bytes

optimized PNG image

283 bytes

optimized GIF image

234 bytes

Comment by Phil Ringnalda #
2002-12-25 17:17:26

Yep, I noticed from the referrer, and already switched to yours for the actual images, though not the inline image (since that would involve actual work on my part). Thanks!

Comment by Gerald #
2002-12-25 17:18:45

Sorry, I tried to insert the optimized images in the above message, but as this was not successful here is the link where you can compare the different versions: http://only-test.com

Comment by Gerald #
2002-12-25 17:29:34

Ooops, an overlap in postings. You are incredible fast!!! It’s fine that you changed the pngs, and as I used a licensed tool for its generation the legal side is fine too :)

Wish you will have a nice remaining christmas time and a Happy New Year.

Name (required)
E-mail (required - never shown publicly)
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.