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

maybe use alpha in place of the 'touched' array? #1

Closed
PerBothner opened this issue Jan 25, 2019 · 3 comments
Closed

maybe use alpha in place of the 'touched' array? #1

PerBothner opened this issue Jan 25, 2019 · 3 comments

Comments

@PerBothner
Copy link

I don't know if this would be a worthwhile change, but it seems like you could get rid of the touched array by just checking if the 32-bit color value has a non-zero alpha component. Or, simpler and faster: just checking if the color value is non-zero.

@jerch
Copy link
Owner

jerch commented Jan 25, 2019

Yes great idea, should speedup toImageData. 👍

(Didnt do it in the first place since I was not sure whether alpha is supported at all in sixel, but seems it is bound to 3 channels only).

@jerch
Copy link
Owner

jerch commented Jan 25, 2019

Just removed the touched array - both parsing and creating final image is way faster. Sweet.

There is still a logical glitch with the fill color as it should not fill the whole target.

@PerBothner
Copy link
Author

Great!

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

2 participants