Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making crop fastere #2

Closed
pelikhan opened this issue Dec 12, 2014 · 2 comments
Closed

making crop fastere #2

pelikhan opened this issue Dec 12, 2014 · 2 comments

Comments

@pelikhan
Copy link

I've noticed that crop was quite slow. The problem is that you are creating and copying a new array on each pixel with .concat. Just use .push to avoid this behavior.

            bitmap.push(data[idx]);
            bitmap.push(data[idx+1]);
            bitmap.push(data[idx+2]);
            bitmap.push(data[idx+3]);
@taggon
Copy link

taggon commented Dec 13, 2014

Great. This make crop so faster than before.
I found your code while I'm looking into the problem.

Thank you.

@oliver-moran
Copy link
Collaborator

Thakns a lot, Pelikhan. A lot faster. I've integrated your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants