You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.
What are the steps to reproduce?
When chaining .blur().threshold() the threshold step is not perfomed
What is the expected behaviour?
.threshold() should be performed
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
importsharpfrom'sharp'importfsfrom'fs/promises'letfile=awaitfs.readFile('test.png')letonepass=awaitsharp(file).blur(10).threshold().toBuffer()//as a temporary workaround one can do a second pass rather than chaining operationslettwopass=awaitsharp(onepass).threshold().toBuffer()fs.writeFile('blurry_but_not_thresholded.png',onepass)fs.writeFile('blurry_and_thresholded.png',twopass)
Please provide sample image(s) that help explain this problem
test.png
blurry_but_not_thresholded.png
blurry_and_thresholded.png
The text was updated successfully, but these errors were encountered:
Hi, your approach to split this task into two passes is correct. (My understanding is that threshold then blur is more generally useful, or at least this was the case when this feature was added in 2015.)
Thanks for the reply. Is there guidance on how this is supposed to work? Intuitively it seems like I should be able to chain things in whatever order I want but this isn't the case? There's some internal order of precedence? Perhaps there's something I missed in the docs? I'm definitely intending to use the operations in the order listed here.
sharp
as reported bynpm view sharp dist-tags.latest
.What are the steps to reproduce?
When chaining
.blur().threshold()
the threshold step is not perfomedWhat is the expected behaviour?
.threshold()
should be performedPlease provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
Please provide sample image(s) that help explain this problem
test.png
blurry_but_not_thresholded.png
blurry_and_thresholded.png
The text was updated successfully, but these errors were encountered: