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

Not working with NumPy 1.20.1 #3

Open
shankhya opened this issue May 3, 2021 · 2 comments · May be fixed by #4
Open

Not working with NumPy 1.20.1 #3

shankhya opened this issue May 3, 2021 · 2 comments · May be fixed by #4

Comments

@shankhya
Copy link

shankhya commented May 3, 2021

I tried halftoning an image using Halftone.py using python halftone.py -l Banff.jpg (-l command for halftoning the images) but the following errors occurred

(Haltone) C:\Users\shank\Documents\Documents\Haltone>python halftone.py -l Banff.jpg
Traceback (most recent call last):
File "halftone.py", line 219, in
CMYK = halftone(CMYK, args.size, args.angles, args.fill, args.sharpness)
File "halftone.py", line 111, in halftone
tiled_kernel = np.tile(kernel, num_kernels)
File "<array_function internals>", line 5, in tile
File "C:\Users\shank\anaconda3\envs\Haltone\lib\site-packages\numpy\lib\shape_base.py", line 1260, in tile
return c.reshape(shape_out)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

If I do not use the -l command, then the resultant images are not halftoned.

Please help me solve this issue.

Thanks,
Shankhya.

@FoamyGuy
Copy link

I am hitting this problem too. I tried downgrading to a lower numpy, but was unable to get that working.

Did anyone ever find a fix for this?

@FoamyGuy FoamyGuy linked a pull request May 18, 2023 that will close this issue
@FoamyGuy
Copy link

There are some values that modern versions of numpy is expecting to be ints but I guess sometime in the past they may have allowed floats.

I was able to work around this issue by adding some int() casting in a few places. I'm not positive if this is the correct solution, but I am now able to get the halftone effect working on my images.

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

Successfully merging a pull request may close this issue.

2 participants