Hey all,<br><br>I can't seem to use the power ("**") operator in the ImageMath module.<br><br><br>For example, multiplying an L-mode image by a factor of 2.0 works fine:<br><br>>>> out = ImageMath.eval( "convert( ( a*val ), 'L')", a=im, val=2.0)<br>
(no errors)<br><br clear="all">However, raising the same image by a power of 2.0 generates a bad operand type error:<br><br>>>> out = ImageMath.eval( "convert( ( a**val ), 'L')", a=im, val=2.0)<br>
Traceback (most recent call last):<br> File "<stdin>", line 1, in <module><br> File "/usr/lib/python2.5/site-<div id=":1hf" class="ii gt">packages/PIL/ImageMath.py", line 203, in eval<br>
out =__builtin__.eval(expression, args)<br>
File "<string>", line 1, in <module><br> File "/usr/lib/python2.5/site-packages/PIL/ImageMath.py", line 119, in __pow__<br> return self.apply("pow", self, other)<br> File "/usr/lib/python2.5/site-packages/PIL/ImageMath.py", line 82, in apply<br>
raise TypeError, "bad operand type for '%s'" % op<br>TypeError: bad operand type for 'pow'<br><br><br>Am I making a silly mistake?<br><br>thanks in advance,<br>Mark<br><br>Ubuntu 8.10 linux, python 2.5.2, Pil 1.1.6</div>