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

could add a new function noise() like imageMagick provided? #725

Closed
ouonet opened this issue Feb 28, 2017 · 4 comments
Closed

could add a new function noise() like imageMagick provided? #725

ouonet opened this issue Feb 28, 2017 · 4 comments

Comments

@ouonet
Copy link

ouonet commented Feb 28, 2017

could add a new function noise() like imageMagick provided?
thanks.

@ouonet ouonet changed the title how to add a new function ,eg. guasenoise could add a new function noise like imageMagick provided? Feb 28, 2017
@ouonet ouonet changed the title could add a new function noise like imageMagick provided? could add a new function noise() like imageMagick provided? Feb 28, 2017
@lovell
Copy link
Owner

lovell commented Mar 1, 2017

Hello, libvips provides a gaussnoise function for this, which we'd need to expose.

It would make the most sense, i.e. will be a bit easier, to add this after #470.

@kimmobrunfeldt
Copy link

This would be helpful in our use case as well.

@jbveepee
Copy link

jbveepee commented Sep 1, 2020

This feature would be useful in our use cases as well.
The sharp documentation says it's straightforward if libvips has the function...
I have no experience with C++ but I'll gladly take a look at how to expose the function if you think it has a chance of succeeding. :-)

@lovell
Copy link
Owner

lovell commented May 24, 2021

This was added via #2527 and included in sharp v0.27.1

https://sharp.pixelplumbing.com/changelog#v0271---27th-january-2021

// Generate RGB Gaussian noise
await sharp({
  create: {
    width: 300,
    height: 200,
    channels: 3,
    noise: {
      type: 'gaussian',
      mean: 128,
      sigma: 30
    }
 }
}).toFile('noise.png');

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

Successfully merging a pull request may close this issue.

4 participants