[Oberon] FW: BMP; was "FPGA - Screen.Mod"

Liam Proven lproven at gmail.com
Thu Sep 21 17:46:56 CEST 2017

On 21 September 2017 at 14:32, Skulski, Wojciech
<skulski at pas.rochester.edu> wrote:
> That is the point. BMP seems to be a very wasteful format because it does not compress anything.

This is one problem with BMP -- and it is not the one that you are
talking about.

It is not as bad as AVI, but it is an issue.

BMP is *not a file format*. It is a *family* of file formats. Some of
them *do* include compression, but only limited compression.


However, because people do not realise that, and think that BMP is a
single format, they do not use the compression features that it has.

Off the top of my head, the BMP sub-formats up to and including 8 bits
per pixel (8bpp) are palettised -- each pixel's colour is stored as a
pointer into a colour palette. These formats support RLE compression
-- run-length encoding.This is very simple, but for an image like a
black-and-white circuit diagram, with large areas of a single colour,
the compression can be quite substantial, and it is lossless, so the
original image can be restored _exactly_ and without any compression
artefacts. (No blockiness etc.)

JPEG can't do this: its compression is optimised for photographs and
on line art, such as a circuit diagram, it will introduce artefacts
and blurring.

PNG is a more complex and capable format, and it can handle both lossy
and lossless compression, AIUI. It can gracefully compress both a
line-art diagram and a photo, and if you wish, produce either a
one-to-one exact replica of a bitmap, with compression, while also
producing small images from high-colour or true-colour images such as

So don't blame BMP for a big filesize -- if it's used wisely and well,
it could produce a much smaller file. But it's a very old format -- I
think it goes back to Windows 1 or Windows 2, in the
early-to-mid-1980s. To use it well, the human operator needs to know
which subformat to pick and what options, and if you don't, it will
not perform well.

GIF came later -- late 1980s, as connecting graphics-capable computers
to one another over telephone lines and audio modems became common --
and supports slightly smarter lossless compression and animation, but
mainly for low colour depths. It has features that are now obsolete
for progressive rendering over very slow comms links, error-handling
and so on.

It's still widely-used, but it shouldn't be. It's obsolete.

> In my experience zipping JPEGs is not reducing their size. Also please note that saving a JPEG has many options. You can play with compression versus quality.

Well, no. It shouldn't. JPEG is heavily compressed already, by smart
algorithms optimised for photos. Zip contains multiple general-purpose
compression algorithms for different types of binary data, not just
images, but it's always lossless. The Zip format is nearly as old as
BMP and nearly as obsolete as the GIF format.

JPEG came long after GIF, and it is a very smart open format, designed
by an international committee of experts, but aimed at only one thing:
making small files out of photos. It's aimed at high colour depths and
has options to produce small files, but it doesn't do animations,
transparency and so on.

If you wanted video, a related group produced MPEG, but there are many
possible roles and uses for video, so MPEG is a complex group of
formats, and some subformats are patent-encumbered, as GIF was for
many years.

PNG is a decade younger than GIF, and supports multiple colour depths
and compression formats, true (i.e. 24-bit or even 32-bit) colour,
transparency and fancy stuff like that. And because it is much richer,
programs can intelligently choose options to produce small files
without loss of image quality. Also aimed at still images, not
animations, though.

Liam Proven • Profile: https://about.me/liamproven
Email: lproven at cix.co.uk • Google Mail/Talk/Plus: lproven at gmail.com
Twitter/Facebook/Flickr: lproven • Skype/LinkedIn/AIM/Yahoo: liamproven
UK: +44 7939-087884 • ČR/WhatsApp/Telegram/Signal: +420 702 829 053

More information about the Oberon mailing list