Python Wand,Color.red_int8(蓝色和绿色)总是返回0

时间:2014-12-05 11:44:38

标签: python wand

运行这个简单的例子:

with Color('#f00') as red:
    print red
    print red.red_int8, red.green_int8, red.blue_int8

第一张照片按我的预期显示srgb(255,0,0)。对于第二次打印,我希望获得255 0 0,但实际上会打印0 0 0

至少文档说明:

blue_int8

(numbers.Integral) Blue as 8bit integer which is a common style. From 0 to 255.

这可能是一个错误,还是我在这里做错了什么?

修改 使用Python3再次尝试(上面是Python2.7)并且它是相同的:

Python 3.4.2 (default, Oct  8 2014, 13:44:52) 
[GCC 4.9.1 20140903 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from wand.color import Color
>>> x = Color('#f00')
>>> x.red
1.0
>>> x.blue
0.0
>>> x.green
0.0
>>> x.red_int8
0
>>> x.blue_int8 
0 
>>> x.green_int8
0
>>>

版本:

$ python2.7 -m wand.version --verbose
Wand 0.3.8
ImageMagick 6.9.0-0 Q16 x86_64 2014-11-17 http://www.imagemagick.org

0 个答案:

没有答案