0
im = Image.new('P', (100,100), 'black')

All this does is return an error saying an integer is needed. How do I create I gif image? OR am I misunderstanding the 'P'. I thought 'P' was to be used for gif images. I'm wanting to be able to fill the image, pixel by pixel with preset colors(0-255) and not have the colors change when I go to save the file. I'm pretty sure from the values I would have to use under RGB that those values would get changed when going back and saving as a gif like in How to CREATE a transparent gif (or png) with PIL (python-imaging). In my program the values CAN'T change.

Community
  • 1
  • 1
confused
  • 1,283
  • 6
  • 21
  • 37
  • can you show the error? docs say this Image.new("RGB", (512, 512), "white") so it shouldn't expect an int there. note color was added after 1.1.4 mentioned in docs too – Foo Bar User Jan 26 '14 at 19:38
  • 1
    Just in case this is helpful to you, or of interest.. http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python/ – Totem Jan 26 '14 at 19:42
  • It says TypeError: an integer is needed. I couldn't figure it out either. – confused Jan 26 '14 at 20:14
  • First, you should probably use Pillow instead of PIL. Second, the color argument appears to default to 0, meaning black, so you might try taking the default. – dstromberg Jan 26 '14 at 20:20
  • Why does it not bother when trying to create a RGB/RGBA image. It creates that just fine. I only run into trouble when I try 'P'. Gee, I...keep learning. I thought PIL and Pillow were one and the same thing. OOPS:) – confused Jan 26 '14 at 20:32

0 Answers0