$ dd if=img.bmp bs=1 skip=54 status=none | xxd -g 3 -c 12
bs=1
- Block size of 1 byte
skip=54
- Skips first 54 bytes, which is header info
status=none
- Hide debug information
-g 3
- Group by 3 bytes (RGB triplet)
-c 12
- Display 4 pixels per row, $ file img.bmp
shows resolution information. Pixel padding needs to be included.