Python Wand, Color.red_int8 (blue and green too) always returns 0

81 Views Asked by At

Running this simple example:

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

the first print shows srgb(255,0,0) as I expected. For the second print I expected to get 255 0 0 but it actually prints 0 0 0.

At least the documentation states:

blue_int8

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

could this be a bug or am I doing something wrong here?

EDIT Tryed it again with Python3 (above was Python2.7) and it's the same:

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
>>>

Version:

$ 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

There are 0 best solutions below