这两种写法,当数据量超过一定程度,内存爆满,电脑直接卡死,严重的电脑都动不了,只能强制重启,问题出在mode="RGB"的设置
result= Image.new("RGB", (w, h))
img = np.zeros((h,w), dtype='uint8')
result = Image.fromarray(img,mode="RGB")
这两种写法,生成的是灰度图,数据量小了写,当然数据量大了还是会卡死
result= Image.new("L", (w, h))
img = np.zeros((h,w), dtype='uint8')
result = Image.fromarray(img,mode="L")