Allow to get the raw image data without going over PIL.Image or NumPy
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in sane.py with the existing dev.snap() implementation and the other scan methods that call start(). Expose the raw snapshot data without requiring PIL or NumPy, and add raw_scan with the same start-before-capture behavior. Done means callers can obtain raw scan bytes through the public API without either optional dependency.
Written by the indexing model from the issue text.
Description
So far there are two officially documented ways of getting image data after scanning: PIL.Image or NumPy array.
They both have their downsides. To only name one per package, PIL.Image lacks 48bit color support which limits all scans to only 24bit and a NumPy array is no image format. To get the data into something with proper image handling support (like a GdkPixbuf) this would have to be converted back to raw bytes, which makes the intermediate NumPy array useless.
Especially as both, PIL and NumPy, are optional dependencies, which are not enforced to use Python SANE, it would be nice to have some basic way to do a scan if neither PIL or NumPy are installed.
I'm currently developing a GUI scanning application in Python using the module, developed here. To do my scanning, I'll use "dev.snap()" which somewhat feels like an "undocumented internal function" but it does exactly what I need.
What I'm asking for is if it would be an useful addition to this module to expose "dev.snap()" in "sane.py" as "raw_snap" and add a convenience method "raw_scan" which, like the other "scan" methods, will call "start()" before calling "raw_snap". If so, I could prepare a Pull Request for this. I will keep using "dev.snap()" in the mean time as there is no useful alternative for now.
- Dominant language
- C
- Stars
- 61
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-pillow/Sane
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
python-pillow/Sane#107 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
python-pillow/Sane#103 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
python-pillow/Sane#93 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
python-pillow/Sane#92 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
python-pillow/Sane#81 · 1 comment ·
All issues in python-pillow/Sane
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100