These are chat archives for pixijs/pixi.js

30th
May 2016
Jakob Steinn
@jstoone
May 30 2016 21:20
Hey Pixies, is there a way to grab the pixel data of a texture? I'm trying to write a tracer, that creates polygon shapes from non-transparent pixels. This will then be used to generate a shadow. At the moment, I'm doing the tracing in PhysicsEditor and then rewriting the plain text coordinates into an array of points in pixi...
Ivan Popelyshev
@ivanpopelyshev
May 30 2016 22:46
Do you want to extract if from screen or Texture or RenderTexture?
renderer.plugins.extract.pixels(texture)
thats for render texture
but if you mean actual image , you can do it old way: create canvas, call getImageData
there's really no other way
Jakob Steinn
@jstoone
May 30 2016 23:03
@ivanpopelyshev, ahaa, yes that extract.pixels() sounds about right!
I am not fixed on any solution, just feeling my way around. I'll be generating a texture from a container, and reading pixels from that, I think.
In that way I'll be able, in some way, to create a polygon from all non-transparent pixels.