~shabbyrobe/bumpy

Experiments with BMP, the most underrated image format in the world
8817d770 — Blake Williams 5 months ago
Finalise migration to sourcehut
ea3829de — Blake Williams 1 year, 5 months ago
Decode as DIB
15f52b93 — Blake Williams 1 year, 5 months ago
Add scour command

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~shabbyrobe/bumpy
read/write
git@git.sr.ht:~shabbyrobe/bumpy

You can also use your local clone with git send-email.

#Bumpy - mucking around with the BMP headers of yore

Dunno why I got obsessed with the fine details of historical BMP and ICO files, but I did for a time there.

This maps out what I found before I moved off to do other stuff. It's extremely incomplete.

If you know of any corners in the BMP format or have any historical links, I'd love to hear about them.

#Usage

Make some bmps in different versions using imagemagick:

convert -type Palette /path/to/clippy.png BMP2:/tmp/clippy-bmpv2.bmp
convert -type Palette /path/to/clippy.png BMP3:/tmp/clippy-bmpv3.bmp
convert -type Palette /path/to/clippy.png BMP:/tmp/clippy-bmpv5.bmp

As a CLI:

$ go install go.shabbyrobe.org/bumpy/cmd/bumpy@latest

$ bumpy hdr /path/to/clippy-bmpv2.bmp
(bumpy.BitmapHeader) {
 FileHeader: (bumpy.FileHeader) {
  Kind: (bumpy.HeaderKind) BM,
  FileSize: (uint32) 31706,
  Reserved1: (uint16) 0,
  Reserved2: (uint16) 0,
  PixOffset: (uint32) 794
 },
 Header: (*bumpy.BitmapCore)(0xc0000b0050)({
  DIBSize: (bumpy.DIBSize) 12,
  Width: (int16) 181,
  Height: (int16) 168,
  ColorPlanes: (uint16) 1,
  BitsPerPixel: (uint16) 8
 })
}
(bumpy.Regions) {
 ColorTable: (bumpy.Region) {
  Start: (int64) 26,
  End: (int64) 794
 },
 Profile: (bumpy.Region) {
  Start: (int64) 0,
  End: (int64) 0
 },
 PixData: (bumpy.Region) {
  Start: (int64) 794,
  End: (int64) 31706
 }
}

#Expectation management

This is a tool I hack on for my own amusement in an ad-hoc fashion. No stability guarantees are made, the code is not guaranteed to work, and anything may be changed, renamed or removed at any time as I see fit.

If you wish to use any of this, I strongly recommend you copy-paste pieces as-needed (including tests and license/attribution) into your own project, or fork it for your own purposes.

Bug reports are welcome, feature requests discouraged, and code contributions will not be accepted.

#License

bumpy is Copyright Blake Williams code@shabbyrobe.org 2022. It is licensed under a 0-clause BSD license.