BeanzMaster: nice trick that helper, filling with an uniform color is better done with a filldword per scanline though. (but I assume that was just a demonstration ).
I made my own simple type for machine vision purposes, and later upgraded it to generics. Using generics I specialize it for 8,16,32 bit.
Some older source is in
hereNote that the code might require generics.collections to run. (part of trunk, separate download for fpc 3.0.4)
Shortcuts is that I avoid a lot of corner cases (like imagewidths not dividable by 4), but on the plus side many simple operations are inlined, and the pixel data block is 32/64 byte aligned which keeps SSE routines simple.