Blog

  • WBMP

    “6.3 Header Data Structure 6.3.1 Multi-byte Integer format The WBMP image encoding uses a multi-byte representation for integer values. A multi-byte integer consists of a series of octets, where the most significant bit is the continuation flag, and the remaining seven bits are a scalar value. The continuation flag is used to indicate that an octet is not the end of the multi-byte sequence. A single integer value is encoded into a sequence of N octets. The first N-1 octets have the continuation flag set to a value of one (1). The final octet in the series has a continuation flag value of zero. The remaining seven bits in each octet are encoded in a big-endian order, ie, most significant bit first. The octets are arranged in a big-endian order, ie, the most significant seven bits are transmitted first. In the situation where the initial octet has less than seven bits of value, all unused bits must be set to zero (0). For example, the integer value 0xA0 would be encoded with the two-byte sequence 0x81 0x20. The integer value 0x60 would be encoded with the one-byte sequence 0x60.”

    Example:

    Hex A0

    Bin 10100000

    Hex 81 20

    Flags and seven bit groups

    1 0000001

    0 0100000

    The two groups of seven bits

    0000001 0100000

    The lower eight bits of that fourteen bit group.

    10100000

    Which in fact is the original binary!

    The quote above is from the documentation about an old monochrome image format known as WBMP. It is used in many older cell phones.

    With a full understanding of this format I could even write it with my own C code.

    The pixel data itself is stored the exact same way that PBM files have except that in this case bits of 0 are black and bits of 1 are white. I already have code that does this that I use for the BMP and TIFF formats.

    The multibyte integer format is only required in the header. It seems that it’s an escape from having to decide how many bytes must be used to represent the width and height.

  • Short Vegan Responses

    As usual, I’m the only vegan at work. However there is this guy who thinks I’m missing out because life is apparently about bacon. I told him pigs are friends, not food. He also asks about why I don’t do dairy and eggs and I told him there was no time to get into it at work. If he really wanted to know there are plenty of good documentaries and books.

    But since he pestered me I gave him the short answers. I don’t breastfeed because I’m an adult and eggs come from vaginas and I don’t like vaginas.

  • Caitlyn Jenner

    This is the first video of Caitlyn Jenner I have ever seen. I remember seeing the magazine cover years ago but never cared because I didn’t even know who Bruce Jenner was. I don’t watch tv or care about celebrities in general.

    However I will say this. When a famous athlete who is the very example of what society thinks a man is still doesn’t feel like a man, it’s a lesson to everyone.

    I have observed that the social value of a man is measured in his strength and money. People objectify men in a different way than women but it’s still wrong.

    So when a strong rich man turns into a woman, society goes mad. They don’t know how to fit this into their beliefs about how the world works. That’s why I’m a fan of Caitlyn, for that reason alone. Thanks for making people think.

  • Binary Pixel Map

    I’m working on a new image format. I’m pretty sure the layout of the format is final. It has all the features of my BBM format but uses a new header which allows for comments because the 4 bytes at address 0x0C are the pointer to the pixel data. This means literally anything could be between the header and the data. In this example a small comment of the name of the format: “Binary Pixel Map”. These screenshots show the equivalent PBM file and the checkerboard that it looks like.

    Screenshot (370)Screenshot (371)Screenshot (372)

    The goal of this format is to be able to eventually support any type of image whether monochrome, grayscale, or full color RGB. The code needs work but if I made a good conversion tool people would see why my format is superior to several others with the exception of compression because I don’t know how that works yet, but I do have a book on it.

  • More Programming Ideas

    I learned something about the Windows Subsystem for Linux. It runs Linux ELF executables that were compiled for Linux. It’s possible to write a program with this system and create something that would run on a 64 bit Linux operating system assuming it also had an Intel CPU.

    The one restriction is that the WSL can’t run GUI apps and is limited to console only. That’s not a real problem for me since I don’t have the skill for that anyway, yet.

    But the fact that Microsoft allows installing Ubuntu Linux inside Windows and the environment runs faster than using a PC emulator means that I now have an additional method of compiling C programs and could produce Linux versions.

    I don’t yet have something ready to publish but I thought of an idea. I could have something that asked a user the details of what kind of checkerboard they wanted. It has 4 variables they could choose.

    Image Width

    Image Height

    Square Size

    First color

    Second color

    I normally set these variables within a C program and recompile whenever I feel like making something. But the concept is simple enough that all it requires is a few scanf calls to request input from a user.