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

Make scipy and PyWavelets optional #217

Open
JanisV opened this issue Jan 15, 2025 · 5 comments
Open

Make scipy and PyWavelets optional #217

JanisV opened this issue Jan 15, 2025 · 5 comments

Comments

@JanisV
Copy link

JanisV commented Jan 15, 2025

It would be great to make scipy and PyWavelets dependencies optional:
pip install imagehash[pywt] or pip install imagehash[scipy]

When scipy is missed we can use numpy implementation of 2D DCT (https://public.websites.umich.edu/~mejn/cp/programs/dcst.py). Also separating DCT function can help with #108.

If you are interested, I can create a PR

@JohannesBuchner
Copy link
Owner

What is the motivation behind this?

@JanisV
Copy link
Author

JanisV commented Jan 15, 2025

Size of Scipy is about 166M. It's too large for my desktop app.
PyWavelets I don't need but I had a truble with it while building flatpak.

@JohannesBuchner
Copy link
Owner

Would "pip install --no-deps" be a workaround for you?
Would uninstalling scipy before packaging be a workaround for you?

I would prefer imagehash to be as useful as possible by default.

@JanisV
Copy link
Author

JanisV commented Jan 15, 2025

Yes, no-deps or uninstalling can help with PyWavelets. But I use pHash and whant implementation without scipy

@JohannesBuchner
Copy link
Owner

Would be good to know if the libraries are bit-for-bit / bug-for-bug compatible in their output.

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

2 participants