What's an image, or an img?

Here's one I made today with cat and emacs. (My first handcrafted image!)

P2
# foo.pgm
18 7
9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 3 3 3 3 0 0 6 6 6 6 0 0 9 9 9 9 0
0 3 0 0 0 0 0 6 0 0 6 0 0 9 0 0 9 0
0 3 3 3 0 0 0 6 0 0 6 0 0 9 0 0 9 0
0 3 0 0 0 0 0 6 0 0 6 0 0 9 0 0 9 0
0 3 0 0 0 0 0 6 6 6 6 0 0 9 9 9 9 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Enlarged twenty times, it looks like this:

image: foo.png

This is artwork.

The purpose of the img tag is to include images--the things which are unable to be replicated in any other medium. A picture is worth a thousand words, and an image has no substitute.

My other comments.

I always like to say:

<img alt="image: such-and-such" src="foo" />

for pictures which are really images (by qualifying for the description "there is no substitute").

I generally don't supply heights and widths. If given, they often prevent proper display of the alternate text. A test for good design: does your site look right with its images replaced with their own alt text, and independent of image size? Allowing images to size themselves makes you think, and in the end saves time.

A rant and rave: Browsers ought to resize images dynamically! I mean it. Manually sizing them defeats this excellent and good-for-you behavior.

I hate, for many reasons, the practice of alt="[something]."

For automatically generated image indexes, I prefer to use alts of "filename, N bytes." (And if an image has 1 byte, more power to it!)

Finally, I disagree with the W3C's rule of "the alt attribute is necessary." In a case where an img is not an image (but a filler, place holder, or whatever), there is no need for alts, and it destroys its own purpose. The idea they recommend, alt="", is quite stupid--but thankfully laughable.

Laughable, however, becomes serious when it is standard behavior.