我想在gif中得到一些像素的rgb颜色。
from wand.image import Image
with Image(blob=img, format='JPG') as picture:
print picture[1][1].string
# return srgb(0,0,0) is good问题:
from wand.image import Image
with Image(blob=img, format='GIF') as picture:
print picture[1][1].string
# return srgb(93%,93%,93%) why?发布于 2019-04-05 03:44:51
这就是颜色合规性的工作原理。并不是像素的所有部分都可以表示为8位无符号整数,因此可以将其表示为0%和100%之间的归一化百分比。
尝试执行以下操作...
from wand.image import Image
with Image(blob=img, format='GIF') as picture:
picture.depth = 8
print picture[1, 1].string
#=> srgb(274,274,274)发布于 2020-07-11 03:13:20
这是我的png代码(python3)
from wand.image import Image
with Image(filename='white_background_320x200_edited_alphaoff.png') as img:
print(img[1][1])https://stackoverflow.com/questions/55522852
复制相似问题