-2

I need to create a white bitmap file with python 3.4. I already searched in the internet but the modules "Image" or "ImageDraw" dont work in Python 3.4. So how can i create a bitmap file? Or maybe which modules i have to use?

Sven
  • 153
  • 2
  • 17
  • possible duplicate of [How do I create a BMP file with pure python?](http://stackoverflow.com/questions/8729459/how-do-i-create-a-bmp-file-with-pure-python) – dg99 Jan 15 '15 at 16:27
  • its better with the PIL solution – Sven Jan 16 '15 at 10:03

1 Answers1

0

Get pillow, which runs on 2.6 to 3.4.

pip install pillow

should work at a command line (and will if in python34/Scripts). Because it is a compatible fork of PIL, it is imported as PIL. I have not used it yet, but from the docs,

from PIL import Image
im = Image.new(<specs>)  # size, pixel deptch
im.save('x.bmp', ...)

should do what you want.

Terry Jan Reedy
  • 18,414
  • 3
  • 40
  • 52