Skip to content

I have queries #440

Closed
Closed

Description

@harshkhandeparkar

Hello!

I am a reviewer from open source organisation publiclab's project image-sequencer. This is an image manipulation lib which works in browser as well as node and CLI. This lib has different modules which are essentially image manipulation steps. Some of them are contrast, brightness etc. Then there are some complex ones like convolution, edge detect.

Heavy Processing

These modules have a pixel manipulation method which runs the same function on every pixel of an image(in serial on the cpu with pure js). This func is used for simple functions like brightness, contrast and channel manipulation. Then there is convolution which is a lot of processing and of course canny edge detection which times out the script. So I had some questions relating to these things:

  1. Have I come to the right place? Can this lib help accelerate processing in the scenarios listed above?
  2. Compatibility: I was playing around with this library on codepen and found that it was showing an error "cannot compile shaders" on an old ~3yrs win8 laptop with a radeon GPU. The same pen was compiling on my phone and working. The kernel is just a nerfed version of the 512by512 matrix mult demo on the website (it multiplies two 20by20 matrices). I can link the pen if needed. If there is an error like this, shouldn't it fallback to cpu mode? The cpu mode worked fine but in gpu mode, the shaders didn't compile.
  3. Nodejs Support: When do you think a stable version of v2 will be available? Will this version be compatible with nodejs? Can the convolution be accelerated in nodejs?
  4. PC slowing down: When I ran the texture mode benchmark on the website, it made the graphics driver on my old win7 pc(~5yrs old) unresponsive "The graphics driver was unresponsive and then recovered". This also made everything but the mouse cursor unresponsive on my new PC which is not even 1yr old and runs ubuntu 18.04(GT 1030, i5 7th gen, 8gb ram). Why does this happen? Is there a way to reduce load on the GPU? The saveOutputToTexture disabled mode did not make the browser/pc unresponsive but texture mode was 459 times faster than the cpu. The GPU only has 2gb graphics memory, is that the reason behind this ?

Thank You!

Activity

  1. robertleeplummerjr commented on Mar 13, 2019

    @robertleeplummerjr
    Member
    1. YES! You've come to the right place. This lib is exactly intended for accelerating arrays of data, of which an image is.
    2. If there is an issue with compatibility, we can find a way to (and already have) shim in compatibility without a performance impact on any other environment short of a simple script that runs on the first build of GPU.js. We just need to be able to reproduce the problem, or help doing so, and a test that detects the instability, a means of correcting it, and unit tests that test with and without the correction, so we know it is a valid test.
    3. Node support is coming in very short order, I believe v2 will be released before end of the week. The following thread is the main holdup: Add webgl draw buffers support stackgl/headless-gl#144
    4. The graphics mode runs without waiting for the next frame, and runs a TON of functions. It freezes your system because it is making use of all your resources. Since you'll be likely running just a few operations (lets say, under 100?) we can easily offset when they run (via window.requestAnimationFrame(), for example) them in a way the browser can handle them without simply testing how fast they are ran, and they will still far exceed the performance of javascript for any substantial size (100x100 maybe?)

    I hope I have answered your questions, if I have not, please reopen this or a new issue.

  2. harshkhandeparkar commented on Mar 14, 2019

    @harshkhandeparkar
    Author

    What will happen if we run pixel manipulation functions on every pixel of a 600by400 image(with texture mode on)? Will it crash?

  3. robertleeplummerjr commented on Jun 1, 2019

    @robertleeplummerjr
    Member

    It should work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions