Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/filter-noise

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/filter-noise

Filter that applies noise to a display object

  • 7.0.0-beta.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
132K
increased by11.27%
Maintainers
3
Weekly downloads
 
Created

What is @pixi/filter-noise?

@pixi/filter-noise is a package that provides a noise filter for use with the PixiJS library. It allows developers to add noise effects to their graphics, which can be useful for creating textures, backgrounds, or visual effects that require a randomized or grainy appearance.

What are @pixi/filter-noise's main functionalities?

Add Noise Filter to a Sprite

This feature allows you to apply a noise filter to a sprite in a PixiJS application. The code sample demonstrates how to create a PixiJS application, add a sprite, and apply a noise filter to it. The noise level can be adjusted using the 'noise' property of the NoiseFilter.

const app = new PIXI.Application();
document.body.appendChild(app.view);

const sprite = PIXI.Sprite.from('path/to/image.png');
app.stage.addChild(sprite);

const noiseFilter = new PIXI.filters.NoiseFilter();
sprite.filters = [noiseFilter];

noiseFilter.noise = 0.5; // Adjust the noise level

Animate Noise Filter

This feature demonstrates how to animate the noise effect by changing the seed value over time. By updating the seed value in the app's ticker, the noise pattern changes continuously, creating an animated noise effect on the sprite.

const app = new PIXI.Application();
document.body.appendChild(app.view);

const sprite = PIXI.Sprite.from('path/to/image.png');
app.stage.addChild(sprite);

const noiseFilter = new PIXI.filters.NoiseFilter();
sprite.filters = [noiseFilter];

app.ticker.add(() => {
  noiseFilter.seed = Math.random(); // Change the seed to animate the noise
});

Other packages similar to @pixi/filter-noise

FAQs

Package last updated on 25 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc