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

Equivalent of ImageMagick's sigmoidal contrast option? #2786

Closed
BrianSHenderson opened this issue Jul 7, 2021 · 2 comments
Closed

Equivalent of ImageMagick's sigmoidal contrast option? #2786

BrianSHenderson opened this issue Jul 7, 2021 · 2 comments
Labels

Comments

@BrianSHenderson
Copy link

I have been using the setting:

-sigmoidal-contrast 20x100%

with ImageMagick which was very useful at optimising faint scans, making them much more readable.

Is there a way this can be achieved with Sharp? For example using linear or modulate methods?

Before:
Screenshot 2021-07-07 at 13 53 52

After:
Screenshot 2021-07-07 at 13 53 59

@lovell
Copy link
Owner

lovell commented Jul 15, 2021

There are no curve-based features currently available, and I think providing the sigmoidal features of *magick would involve sharp exposing libvips' tonelut operation.

If you're dealing with faint scans of handwriting then using threshold with a high value might also be suitable, e.g. with threshold(254) I see:

The improvements to normalise discussed in #200 might also help.

@lovell
Copy link
Owner

lovell commented Aug 13, 2021

I hope this information helped. Please feel free to re-open with more details if further assistance is required.

@lovell lovell closed this as completed Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants