Jump to content

How to get texture image data?


iamchairs
 Share

Recommended Posts

I am using Pixi webgl to do some edge detection. Not only would I look to incorporate multiple edge detection methods to get a better results, but I will eventually need to grab the resulting image to analyze the eges.

I've created a sprite from the following image-

 

box.jpg

 

And through some custom filters (shaders) I get something like this-

 

Screen Shot 2016-12-31 at 3.30.08 PM.png

 

How to I get the resulting image data after all filters are ran? I'm hoping this doesn't require me to use the 2d context.

  var img = PIXI.Sprite.fromImage('uploads/' + imgFile);
  
  console.log(img);

  img.x = width / 2;
  img.y = height / 2;
  img.anchor.set(0.5);

  img.filters = [
    grayScaleFilter,
    new PIXI.filters.BlurFilter(0.1, 1, 1),
    edgeDetectFilter,
    //sobelXFilter,
    //sobelYFilter,
    //prewittXFilter,
    //prewittYFilter,
    highlightFilter
  ];

  stage.addChild(img);

 

Edited by iamchairs
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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