TIFF output, bitdepth of 1 with LZW compression, should ignore predictor
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 32.7k
- Forks
- 1.4k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Description
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
- Running
npm install sharpcompletes without error. - Running
node -e "require('sharp')"completes without error. - I am using the latest version of
sharpas reported bynpm view sharp dist-tags.latest.
What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?
System:
OS: Windows 10 10.0.22621
CPU: (6) x64 Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz
Memory: 20.28 GB / 63.95 GB
Binaries:
Node: 19.2.0 - C:\Program Files\nodejs\node.EXE
npm: 9.1.3 - C:\Program Files\nodejs\npm.CMD
(tried also node 16.x and npm 8.x)
What are the steps to reproduce?
image.toColorspace('b-w').toFormat('tiff', { bitdepth: 1 }) // works, exports a 1-bit tiff file
image.toColorspace('b-w').toFormat('tiff', { bitdepth: 1, compression: 'lzw' }) // works, but exports a 24-bit file.
What is the expected behaviour?
the second row will export a 1-bit (or 2 or 4) bit TIFF file.
Thanks for all ! I like the package and it works good and fast.
Contributor guide
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.
Research direction
Start by running the two image.toColorspace('b-w').toFormat('tiff', ...) examples from the issue and compare their output bit depth. Trace the TIFF conversion path used by sharp for bitdepth 1 with LZW compression, then verify that the resulting 1-, 2-, or 4-bit TIFF behavior matches the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100