簡體   English   中英

Python寫/讀RGB圖像

[英]Python write/read rgb Image

我已經測試過使用Image編寫和讀取一個像素的jpg文件:

data_ori = np.zeros((1, 1, 3), dtype=np.uint8)
data_ori[0,0]=(1,20,300)
img = Image.fromarray(data_ori, 'RGB')
img.save("toto2.jpg")
im = Image.open("toto2.jpg")
pix = im.load()

print(pix [0,0])給出(2,20,44) 有人有主意嗎?

@ Aran-Fey使用gif格式效果很好

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM