15 September 2014

HTML needs bitonal images

The only purpose of this post is to preserve links to the following post, whose title I changed, without realizing that a title change causes a URL change!

The newly-title post is here: http://dencklatronic.blogspot.com/2014/09/the-web-needs-bitonal-images.html

11 September 2014

The web needs bitonal images

Web browsers are missing an important feature: bitonal images.

For my purposes at least, I define a bitonal image as a uni-dimensional image, whose scale varies from an undefined background color to an undefined foreground color. So, it is like a grayscale image, but instead of varying from black to white, it varies from an undefined background color to an undefined foreground color.

I'm also assuming that a bitonal image feature would support transparency, in which case it would support a scale that varies from transparent to an undefined foreground color.

The basic problem is that without bitonal images, the colors used in a page's uni-dimensional images cannot be kept in sync with the page's surrounding text colors.

Here, by "uni-dimensional images," I mean images that vary from a fixed background color (or from transparent) to a fixed foreground color, even though these images may be represented multidimensionally, as in RGB. In other words, by "uni-dimensional images," I mean images that could be represented as bitonal, but they are not, since no such representation exists (to my knowledge).

This brings me to an important point. Bitonal images could be implemented by extending an existing image format, in which case no extension to HTML would be needed, though web browsers would need to be upgraded to interpret this new feature of, for example, PNG.

Alternately, bitonal images could be implemented by extending HTML, perhaps as a new attribute of the IMG element that would instruct the browser to "deliberately misinterpret" a grayscale image as a bitonal image. (By "HTML" I mean to include CSS. I.e., I am agnostic as to whether the bitonal image feature, if it does not reside in an image format, should reside in HTML or CSS.)

My particular motivation for wanting bitonal images is ebooks. Ebooks readers are basically specialized web browsers, since the two most commercially important ebook formats are the following.
  • EPUB, which is based on HTML
  • Kindle (MOBI/KF8), which is usually generated from EPUB
The reason why bitonal images are particularly important for ebooks is that, unlike most web browsers and web sites, many ebook readers allow the user to set the foreground and background colors.

So whereas the lack of bitonal images on web pages is primarily an inconvenience for web designers, the lack of bitonal images in ebooks is an inconvenience for end users. For example, consider these following two different "statements of pain."
  • Web designer: "Argh! We can't redo the color scheme without re-generating our images!"
  • Ebook end user: "Argh! I like black-on-beige text but it makes this book's images stick out like a sore thumb, since they are stuck as black-on-white!"
Another reason that the lack of bitonal images is particularly important for ebooks is that many ebooks encode non-Latin characters as images, since unfortunately for a long time many ebook readers did not have Unicode support. It is particularly jarring when such "text-only images" do not match the foreground and background colors of the surrounding text.

Here are some examples of problems created by the lack of bitonal images in ebooks. These are screen snips from the Kindle for PC ebook reader.  I show each example two ways. First, I show it with a problematic color scheme (white-on-black or brown-on-beige) and then I show it with the black-on-white color scheme, in which case there is no problem.

Finally, a few random concluding notes and questions.

A "shout-out" is due to AutoCAD, since it seems to implement bitonal images.

Does SVG inside HTML already support bitonal images? E.g. can the color of SVG strokes be set to inherit from the enclosing HTML? Can this even be done for the color of SVG text? (Both strokes and text would of course be desirable.)

Fonts can, somewhat perversely, be thought of as special-purpose bitonal image formats. In some sense, this is what has created the whole problem: if fonts weren't bitonal, we wouldn't need bitonal images to match text colors!

But, on the flip side, fonts can, somewhat perversely, be used to allow bitonal images in HTML today. The idea is, somewhat perversely, to encode the images that need to be bitonal as glyphs in a custom font. (This may not be so perverse if the images are in fact being used to overcome character set limitations, e.g. spotty Unicode support.)

The End.

Update: a friend who shall remain nameless found the following Stack Overflow discussion of how to implement something close to a bitonal images feature:

The closest thing to bitonal images, at the moment, seems to be the CSS "filter" property, e.g. as described here:


The "filter" property (in its webkit-specific form) is intriguingly demonstrated here:

and here:

I may be missing something, but it seems like the "filter" property, though offering something close to bitonal image support, isn't there yet.

In particular, the "filter" property offers grayscale() and sepia(), but bitonal image support (at least as I have defined it) would require something like foreground(). I.e. grayscale() and sepia() are mapping the image along two specific background/foreground scales, rather than mapping the image along a "current background" to "current foreground" scale.

30 June 2014

Ebooks from Sources

Here’s a link to a minimal, work-in progress web site advertising my ebook consulting services: http://bdenckla.github.io/efs/.

01 May 2014

The Prophet Lorax

One of the most profitable aspects of my Jewish journey has been learning about the Hebrew Prophets, particularly the Latter Prophets. A basic but ongoing challenge to that learning is just trying to understand what a prophet is in our tradition.

Initially, like many people, I thought that the main feature of a prophet is his prediction of the future. In other words, I viewed a prophet as a seer.

But, now I think the main feature of a prophet is his seeing the present more clearly than other people. A prophet's predictions of the future serve only to emphasize his points about the present. To exhort people to change their behavior now, a prophet predicts rewards and punishments.

Although the behaviors the prophet wants to change are often personal, the rewards and punishments he predicts are usually societal, or even global. This system of reward and punishment that the prophet predicts may not appeal to us, or it may appeal to us but seem a naive fantasy. Either way, it may be a "turn-off."

I want to encourage people to get turned back on to the prophets. To that end, I think it may help to view the predicted rewards and punishments as only tactics that the prophets use to achieve goals of the good and the holy.

So, though these tactics may not appeal to us, I earnestly hope that the goals still do.

Particularly at risk is the goal of the holy. The goal of the good is one respected and pursued by many. Good is of course always threatened by evil. And, nowadays, it is threatened by a relativism that has made the categories of good and evil unfashionable. But the greater threat is to the concept of the holy, which is so out of fashion in some circles, and so perverted in others, that I fear for its survival.

A prophet speaks inconvenient truths to try to make us good and make us holy. He also offers us hope that this daunting task can indeed be done. 

Another journey I'm on is raising kids. One of them got The Lorax by Dr. Seuss as a birthday present. As I read it to them, I realized, hey, this guy The Lorax is a prophet!

Well, maybe he's not a prophet, if that seems blasphemous to you, but at least he's a darn good (and fun) illustration of the most important features of a prophet.

I won't review the book here, but suffice it to say that the Lorax spoke inconvenient truths to try to make the Once-ler good. In the end it is the Once-ler, not the Lorax, who offers hope, though, in the form of a seed.

The idea of the holy is missing, or, rather, must be supplied by the reader. Perhaps it is better that way.

The idea of divine inspiration is missing, too. It is missing both from the Lorax and from my discussion of prophets. Perhaps it is better that way.

In closing, let me provide a couple of links showing other people's exploration of the idea of the Lorax as a prophet.

The Lorax, the Prophets, and the iPad

The Lorax and Deuteronomy

09 August 2013

My People's Giant Passover Haggadah

Thanks to the suggestion of Rabbi Joel Nickerson, I have been enjoying My People's Passover Haggadah: Traditional Texts, Modern Commentaries (henceforth MPPH).

It got me thinking about the design challenges of Jewish books.

Like many Jewish books, MPPH contains many related texts.

So a design challenge of such a book is to use resources such as layout and font to show how its texts are related. Making these relationships clear makes it easier for the reader to know his or her location within the complex structure of such a book. And it makes it easier for the reader to navigate within such a book.

A Talmud is a great example of such a book. Take a look at this neat PDF (by Joshua Parker) to get a sense of how a Talmud addresses the challenges of presenting multiple related texts.

Part II of MPPH is a sequence of sections. Each section contains a number of elements. The elements are of the following types and "multiplicities" (how many are expected).
  1. 1 Haggadah passage (Hebrew and/or Aramaic)
  2. 1 Translation of the Haggadah passage into English
  3. 1 Summary of the meaning of the passage (a "signpost")
  4. 0..n Ceremonial instructions, each belonging to a location within the Haggadah passage
  5. 0..n Images
  6. 8..11 Commentaries on the passage
(Note that Part II is not be confused with Volume 2. Like many Jewish books, another design challenge of MPPH is that its sheer length requires it to be split into multiple volumes!)

MPPH uses various techniques to show how the elements of a section are related.

The most notable technique it uses is what I will call the anchor spread. (I'm using "spread" to mean two facing pages.)

Here is an example. (I've provided it only at low resolution since I'm only interested in the layout, not the content.)

At the center of the spread is the beginning of the Haggadah passage in question, with English on the left and Hebrew/Aramaic on the right.

Surrounding the passage and its translation are the beginnings of the commentaries. Each commentary beginning is followed by an indication of the page on which the rest of the commentary appears. This indication is also known as a jump line or continuation line. (The Haggadah passage itself has no jump line since it continues immediately after the anchor spread.)

So in some ways the anchor spread resembles the first page of a newspaper section on which many articles are started, but most or all need to be finished elsewhere.

The anchor spread design got me thinking... what if jumps were not needed, i.e. what if the complete commentaries surrounded the complete Haggadah passage?

I.e. what would it be like if you could really see where you were within the "landscape" of the section?

To partly answer this question, I did the following.

  • I extracted the elements of the "4 questions section" from a digital version of MPPH. I hope I didn't break any laws (or breach any contracts) in the process. Just in case, I will not reveal the details of how I did this. I'm sure what I did was ethical, but of course ethics and the law are not always aligned.
  • I laid these elements out on a single giant page using the Scribus open source desktop publishing software.
  • For $10.90, I had a print shop print this out for me on a large-format printer, something like the following.

Here's the result (bill shown for scale):

Here's a link to a redacted PDF version of it on Scribd. This version is redacted to avoid copyright infringement. (Hopefully the picture of the un-redacted version above is low enough resolution to avoid anyone considering this copyright infringement.)

That was fun, but many questions remain. Could you do the whole book this way? How would you bind, or otherwise package, such a giant book? As a flip chart on an easel?

About ten years ago, Michael Hawley published the world's biggest book (at least at that time). I wonder what could be learned from that experience.

Going in a different direction, how can this "jumpless" large format experience be emulated (or improved upon!) digitally? A goal being, how can you, as seamlessly as possbile, zoom out to see structure, and zoom in to view content in detail, without losing a sense of your place within the structure?

I'm sure smart people have come up with interesting approaches to such problems and look forward to learning more about them. Perhaps I'll report what I find out in a subsequent post.

03 February 2013

How I made our computer quiet

One of the two (!) fans in our computer's power supply has been getting more and more raucous over the past few months. I don't know whether this means it was close to actually stopping, but it was certainly close to actually driving me crazy. So, somewhat out of character for me, I decided to finally try to do something about it. Big mistake.

I found the following three options for what to do.
  1. Lubricate the fan.
  2. Replace the fan.
  3. Replace the power supply.
I decided to replace the power supply. It seemed a little wasteful, but lubricating the fan didn't seem guaranteed to succeed and I was scared off of replacing the fan by warnings about capacitors holding a charge for hours.

A brief digression. I found it amusing to see, in an online discussion of what lubricant to use, a British person asking for the equivalent of "gun oil" since shops in his country don't commonly sell it, or sell guns, for that matter! (It was speculated that "sewing machine oil" would be similar.)

So I was determined to get a new power supply but not spend a huge amount of time figuring out what the best one would be. I fear I waste a lot of time shopping online for things, optimizing on margins that don't matter. Well it turns out it would have been worth spending some time figuring out what a correct one would have been, leaving aside the question of what the best one would have been.

I found some random site that offered a nice-looking lookup of power supply by computer name, and trusted it. Big mistake.

It turns out there has been a lot of evolution of the ATX power supply standard over the years. As is so often the case, there's a good Wikipedia article covering it. I only wish I had read it before plugging my new power supply in. (Digression: since it is so often the case that there is a good Wikipedia article about things, I've recently donated to Wikipedia, and plan to do so regularly, and encourage you to do so, too, if you find it useful.)

So, I plugged my new power supply in, and everything seemed fine, but when I came back a few hours later, there was a strange smell in the room and the computer was off and would not turn back on, even with the old-but-noisy power supply plugged back in. Woops.

So, making good on the promise implicit in the title of this post, that's how I made our computer quiet. Very quiet. One might even say silent.

I lack some combination of the skill and the inclination to figure out exactly what happened, but my not-too-wild guess is that you shouldn't plug a 20-pin power supply into a 24-pin motherboard. I guess I was hoping that if it wouldn't work, it just wouldn't work. Meaning, I hoped that if it wouldn't work, it would fail in the following three ways.

  1. obviously
  2. immediately
  3. non-destructively

Well, it did fail obviously. But not immediately, and not non-destructively.

Was my wishful thinking a product of "overly digital" thinking? Though digital systems have plenty of non-obvious, non-immediate, destructive failure modes, somehow I think analog systems have even more.

And power supplies are about as analog as you can get. In fact, they're not even analog: they're power! Power is the analog of nothing! Or, put it this way, I've never heard of power being used as the analog of anything. Voltage, certainly. Current even, sometimes. But power, never.

Returning from that digression, my point is, that what probably happened is that things did work, initially, and then once something heated up, over time, something on the motherboard melted or burned.

It turns out that those 4 extra pins are supplying "redundant" 3.3, 5, and 12 V lines, as well as ground. Not having them forces the other pins to carry more than their "fair share" of the current. Unfortunately I guess the weak point in the system was on the motherboard, not in the power supply. Otherwise plugging the old power supply back in would have worked.

So then I set about spending several should-have-been-sleeping hours researching the current offerings of Dell and HP. In other words, my mistake has led me to the most wasteful option, the following implicit option number 4.
  • Replace entire computer.
Whenever I research buying a new computer I'm always shocked by the way in which each manufacturer divides their products into confusing, overlapping market segments, where it seems like the same computer is being offered over a 4x price range with the only obvious difference being different case design. (It turns out there are deeper differences, you just have to spend several hours to start to get a grasp of them. Whether these differences justify the 4x price range... well, if the market bears it, I guess the answer is revealed to be "yes.")

So, I'll be spending a little quality time over the next few days setting up a hopefully-nice new Windows 8 machine.

Still to be determined whether I will shell out $100 to upgrade from Windows 8 to Windows 8 Pro. I am curious to try to run Ubuntu under the "Hyper-V" virtualization built into Pro, but probably I should just save $100 and use VirtualBox, like I do with great success and ease on MacOS on my MacBook Pro.

Also, will we ever want to connect to the machine using Remote Desktop? For that, you need Pro.

Decisions, decisions.

But at least these decisions are back in the realm of software, where I feel more comfortable.

Because if there's one take-home lesson from this experience, it is that I shouldn't have felt comfortable in the realm of power. She is a cruel mistress, the analog of nothing.

28 December 2012

The Chapman Exchange

I spotted the following use of the old "2L-5N" (2 letter, 5 number) dialing instructions on a sign on a fence at Rancho Park Golf Course in Los Angeles.

The sign advertises the Cyclone Fence Division of American Steel & Wire Co.

It also mentions United States Steel. Was American Steel & Wire Co. just a part of that (USS)?

Anyway, the address given is 5532 San Fernando Road, Glendale, Calif.

And the phone number, the reason for my interest, is CHapman 5-2635.

The sign also advertises locations in Oakland, San Francisco, Seattle, and Portland.

Though the use of 2L-5N is what most caught my attention, the typography is pretty neat, too. In particular, the big fat font used for the main text of "CYCLONE FENCE."