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

Add function signature to the sharpen function #2561

Closed
nateisleychamp opened this issue Feb 5, 2021 · 2 comments
Closed

Add function signature to the sharpen function #2561

nateisleychamp opened this issue Feb 5, 2021 · 2 comments

Comments

@nateisleychamp
Copy link

@nateisleychamp nateisleychamp commented Feb 5, 2021

We call functions like resize and modulate with their parameters in an object, which results in calls like:

sharp(input)
  .modulate({
    brightness: 0.5,
    saturation: 0.5,
    hue: 90
  });

sharp(input)
  .resize({ width: 100, height: 300 });

But this does not work:

sharp(input).sharpen({ sigma: 2, flat: 2, jagged: 3 }

What are you trying to achieve?
Symmetry with how I call other functions

Have you searched for similar feature requests?
Yes. My search did not turn up any issues.

@lovell
Copy link
Owner

@lovell lovell commented Feb 5, 2021

Happy to accept a PR, if you're able, that adds the ability to use this approach whilst maintaining the existing API.

@lovell lovell added this to the v0.30.3 milestone Mar 9, 2022
lovell added a commit that referenced this issue Mar 9, 2022
@lovell
Copy link
Owner

@lovell lovell commented Mar 14, 2022

The Object-based approach for setting sharpen parameters is now available as of v0.30.3. The previous approach still works and is now deprecated.

https://sharp.pixelplumbing.com/api-operation#sharpen

@lovell lovell closed this as completed Mar 14, 2022
martinj pushed a commit to aptoma/sharp that referenced this issue Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants