Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gizeh.ImagePattern broke using Numpy ver 10 #25

Open
dessskris opened this issue Mar 24, 2016 · 3 comments
Open

gizeh.ImagePattern broke using Numpy ver 10 #25

dessskris opened this issue Mar 24, 2016 · 3 comments

Comments

@dessskris
Copy link

File "animation/target_animation.py", line 161, in draw
    fill = gizeh.ImagePattern(self.bg.data, self.bg.pos, filter='best')
  File "build/bdist.linux-x86_64/egg/gizeh/gizeh.py", line 295, in __init__
  File "build/bdist.linux-x86_64/egg/gizeh/gizeh.py", line 50, in from_image
TypeError: Cannot cast ufunc add output from dtype('float64') to dtype('uint8') with casting rule 'same_kind'

I tried reporting this issue to numpy but they said the gizeh code needs to be modified:
You need to make the cast explicit using the casting argument in the np.add ufunc. That is casting='unsafe'.

Would you fix this issue please? I would like to use gizeh and the latest version of numpy.

@alexbw
Copy link

alexbw commented Apr 15, 2016

For ref: numpy/numpy#7225

@mantielero
Copy link

It can be fixed by modifying line 50 in "gizeh.py" from:

  arr += image.flatten()

to:

    #arr += image.flatten()
    np.add(arr, image.flatten(), out=arr, casting="unsafe")

bitblomster added a commit to bitblomster/gizeh that referenced this issue Jan 30, 2018
…viour, as described in gizeh issue Zulko#25 and numpy issue #7225
@bitblomster
Copy link

Pull request #32 should fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants