0

I am trying to start writing a BMP image file with python without using any importing any libraries like PIL or Image just to learn how it works,

I started by looking up at the documentations and how BMP files are formatted from this article but I had no clue how to start, and what is a WORD and DWORD datatypes

Marox Tn
  • 142
  • 9
  • Word and dWord are ints of the cpu/arch word and double word sizes. In a 32 bit system the word is 32 bits wide. Bear in mind that if you are using a 32bit low level api you'd most likely be using 32 bit words even on 64 bit system. More details https://en.m.wikipedia.org/wiki/Word_(computer_architecture) – Machinarius Mar 08 '16 at 20:49
  • @Machinarius And how to use them in python ? – Marox Tn Mar 08 '16 at 20:53
  • I really don't know about python but most managed languages define the int and byte data types as a word for the platform the runtime is compiled for (.net and Java do this). This might help you http://stackoverflow.com/q/6918291/528131 – Machinarius Mar 08 '16 at 21:01
  • A dotnet example: https://dotnetfiddle.net/BR7cfs - 4 bytes * 8 bits = 32 bits, the word size of a 32 bits runtime – Machinarius Mar 08 '16 at 21:08

0 Answers0