草庐IT

python - 使用 PIL 保存图像

我正在尝试保存使用PIL从头开始​​创建的图像newImg1=PIL.Image.new('RGB',(512,512))pixels1=newImg1.load()...foriinrange(0,511):forjinrange(0,511):...pixels1[i,511-j]=(0,0,0)...newImg1.PIL.save("img1.png")我收到以下错误:Traceback(mostrecentcalllast):File"",line1,inFile"C:\Python27\lib\site-packages\spyderlib\widgets\external

python - 使用 PIL 保存图像

我正在尝试保存使用PIL从头开始​​创建的图像newImg1=PIL.Image.new('RGB',(512,512))pixels1=newImg1.load()...foriinrange(0,511):forjinrange(0,511):...pixels1[i,511-j]=(0,0,0)...newImg1.PIL.save("img1.png")我收到以下错误:Traceback(mostrecentcalllast):File"",line1,inFile"C:\Python27\lib\site-packages\spyderlib\widgets\external