Press "Enter" to skip to content

Add Pixels Particle Animation to An Image | Pict2Pix.js

Pict2Pix.js is a library for adding pixel animation to an image using the Canvas API.

Pict2Pix particles, Pict2Pix particles examples, pixi particles editor, pixi particles cdn, particle effects generator, pixijs, Pict2Pix js particle example

Options

  • image: Mandatory. It is the image which you want to add de pixels effect
  • numberOfParticles: Optional. A number of particles in the image. Be careful about the perfomance if you add a big number of particles. The default value is 3000.
  • horizontalSpeed: Optional. The horizontal speed of the particles. Can be positive or negative. Zero for no horizontal movement. The default value is 1.
  • verticalSpeed: Optional. The vertical speed of the particles. Can be positive or negative. Zero for no vertical movement. The default value is 1.
  • particleType: Optional. Type effect. The default value is ‘straight-particle’
    • ‘straight-particle’
    • ‘twisted-particle’

How to make use of it:

1. Import the minified model of the Pict2Pix.js library into the doc.

<script src="/dist/pict2pix.min.js"></script>

2. Initialize the library on the goal picture and complete.

<img id="image-demo" src="demo.jpg" />
const imageDemo = document.getElementById('image-demo');
window.onload = function initialize() {
  pict2pix.animate({
    image: imageDemo
  });
}

3. Specify the particle sort. Can be both ‘straight-particle’ or ‘twisted-particle’.

pict2pix.animate({
  image: imageDemo,
  particleType: 'twisted-particle',
});

4. Specify the variety of particles to generate.

pict2pix.animate({
  image: imageDemo,
  numberOfParticles: 500,
});

5. Config the animation speed.

pict2pix.animate({
  image: imageDemo,
  horizontalSpeed: 1,
  verticalSpeed: 1,
});

Apply Fancy Pixel Particle Animations To Images, Pict2Pix.js Plugin/Github


See Demo And Download

Official Website(evaristocuesta): Click Here

This superior jQuery/javascript plugin is developed by evaristocuesta. For extra advanced usage, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.