Write a NumPy program to convert a numpy array to an image. Display the image
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
from PIL import Image
import numpy as np
img_w, img_h = 200, 200
data = np.zeros((img_h, img_w, 3), dtype=np.uint8)
data[100, 100] = [255, 0, 0]
img = Image.fromarray(data, 'RGB')
img.save('test.png')
img.show()
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال