Jump to content

[Help] Sprite with solid color


gaconvn
 Share

Recommended Posts

There are four options for this:

1. To change this spritesheet and replace the black with transparent, open it with Photoshop/Gimp or even something online like https://pixlr.com/editor/ and do it manually.

2. Using a bitmap mask. This way confused me, you're on your own if you want to research it. Here's a Phaser example.

3. Using PIXI's ColorMatrixFilter, you can modify all pixels with a computation matrix. You'll need to include a few extra JS files no longer included in Phaser. Here's sample code of how it works:

var whiteFilter = new PIXI.ColorMatrixFilter();
whiteFilter.matrix = [ 1,1,1,1, 1,1,1,1, 1,1,1,1, 0,0,0,1 ];
someSprite.filters = [ whiteFilter ];

4. Run a function on your spritesheet for each pixel in it and modify the pixel, creating a new asset. Here's a Phaser example.

 

It depends on what you're trying to do.

Link to comment
Share on other sites

If I understand, you want to change the black background into transparent. In that case I'd use photoshop, is very easy to do it. I'd try first the background remover, setting the tolerance between 15-20% and 20 minutes (even less) of your time, you can clean all that black background.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...