Two Lions Holding The Zürich Flag

Heraldic hatchings

Two Lions Holding The Zürich Flag

I really like the logo used by the city of Zürich: it has a modern look, but keeps all the traditional elements of the city, the two lions and the white and blue flag. How do you know the lower left part of the flag is blue? It has the traditional heraldry hatching for blue, horizontal lines.

You can see these patterns in many places in Europe, each time a flag had to be printed or engraved into a wall. The hatching patterns for the most common colours, black, white (silver), yellow (gold), red, blue and green, defined by , are pretty standard, but there are many other patterns for less common colours.

I really like the idea of representing colours using standard patterns, so I hacked together a quick JavaScript program that takes an image and converts it into its heraldic black and white equivalent.

The code is very simple, it just looks up each individual pixel and replaces it with the corresponding hatching – it does the job if the input is an image with flat areas with saturated colours. It supports all the colours described in the french wikipedia page on the subject. The only difference is that black is rendered as solid black, as this gives better results, and is consistent with black and white printing (as opposed to engravings).

To use it, simply upload an image, then click on the transform button, if you want to save the result, click on the download button. The code is far from perfect, there is no pre-processing, so you need images with flat colours and sharp lines (no anti-aliasing). The threshold between orange and brown is a bit problematic. The code is available on github.

Flattr this!

MB6S chip

Cheap Electronics

Solar Lamp Internal Circuitry

Even though most electronic gizmos are built in China, there are pretty large differences in price between models. I recently bought a solar camping light. It looks like very good value for money: for twelve swiss francs, you get a foldable lamp, which can recharge using a solar cell, from the 230V main, there is also a compartment with three AA batteries. You can use the lamp as a USB power source.

MB6S chipSo where is the catch? While the lamp comes with an EU plug, that plug is very small and narrow, and barely fits within a swiss socket. The USB connector was not well aligned, so I had to fix it with pliers because being able to connect anything to it. I put it to charge, and the next day, the lamp was dead. Theoretically these things come with a warranty, but you have to ship the stuff back to china. Given the price, it is not worth the hassle, so I opened the lamp to see how it is built inside.

Unsurprisingly, the electronic part is very simple: there is a single small board that does all the conversion, it contains a MB4S chip (a bridge), two condensers and a few other components. My electronics knowledge is very rusty, but this looks like a non-isolating Zener supply, cheap, but not efficient (5%) and non isolating, the USB output is exposed to the power-variations and noise from the main. What I interesting is how thin the 230V wires are, and how little galvanic separation there is between the 230V area of the chip and the low voltage part. This feels cheap and not very secure, that such a simple circuitry with no mobile parts died so quickly is not a surprise, in the end you get what you pay for…

Flattr this!