question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

extract plugin improvement suggestion

See original GitHub issue

Hello,

This is to suggest an improvement to the extract plugin API.

What I am trying to achieve is fetching a single pixel from an offscreen rendered container. For this purpose, I use the extract image API.

By extracting the image and then rendering it into a canvas I can then read the desired pixel. However, I only need a single pixel from the image and therefore this solution is overkill.

Here is the current usage of the extract.image API:

const image = renderer.plugins['extract'].image(container);

The extract.pixels API is probably faster but still overkill. However it is made unusable by the fact that it is impossible to know the dimensions of the image that the pixels represent:

const pixels = renderer.plugins['extract'].pixels(container);

The pixels object is an array, it contains no information on width or height.

Ideally, the extract.pixels and extract.image APIs would accept a scale, a position and a dimension:

const pixels = renderer.plugins['extract'].pixels(spineView.parent, scale, x, y, width, height);

The position and dimension would determine which part of the container to clip for extraction purposes. And the scale would define the scaling ratio of the rendering. For instance a 200x300 clipped extraction with a scale of 0.5 would generate a pixel buffer corresponding to a 100x150px dimension.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bchevaliercommented, Mar 15, 2022
1reaction
bigtimebuddycommented, Mar 14, 2022

Use an options object with this many arguments. There are too many arguments here to remember the order, so object is better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plugin improvement suggestion | WordPress.org
Currently I'm working on a project, that required to delegate 'manager' user group to manage users of particular groups (add / edit). I...
Read more >
Basic Report plugin improvement suggestion - Katalon Studio
Hello guys,. I was thinking about this topic few days. Well, I'm very disappointed in the plugin, which is given in plugin store....
Read more >
Improve migrate messages from the extract plugin - Drupal
Problem/Motivation When the extract plugin fails to find the requested array element ... In the first case, suggest adding a default option.
Read more >
45% Improvement Suggestions come via Product's Guide Page
I am have a pretty good documentation of Documentor WordPress plugin but still people come with questions and even sometimes with eye opener ......
Read more >
Improvement/Suggestion (Size request for export) - GitLab
Example: YouTube has a 2mb cap on Thumbnail images. It'd be nice if as part of the export options you could choose an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found