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

Dramatically improve "Fast" linear-RGB conversions. #20

Merged
merged 4 commits into from
Aug 26, 2017
Merged

Conversation

lucasb-eyer
Copy link
Owner

This is following the discussion in #18.
Documentation and a notebook for deriving the constants will follow.

@lucasb-eyer
Copy link
Owner Author

For reference, the benchmark values on my laptop (i7) are:

><((("> go test -bench .
Testing up to 100 palettes may take a while...
Done with that, but more tests to run.
BenchmarkColorToLinear-8       	 5000000	       335 ns/op
BenchmarkFastColorToLinear-8   	20000000	        75.6 ns/op
BenchmarkLinearToColor-8       	 5000000	       334 ns/op
BenchmarkFastLinearToColor-8   	20000000	        83.4 ns/op
PASS
ok  	github.com/lucasb-eyer/go-colorful	21.607s

which I'd call a success, given the accuracy is still within ~2 RGB values (out of 255)

This is following the discussion in #18.
Documentation and a notebook for deriving the constants will follow.
@Ravenslofty
Copy link

Very well done! It's actually beginning to look feasible to try out using L*a*b* in a large(ish) render. I do have a few algorithmic flaws of my own to try to resolve, like comparing a pair of points multiple times in a pass, but still, thank you very much!

@Ravenslofty
Copy link

You misspelt "tight" in 43afed8, @lucasb-eyer.

@lucasb-eyer lucasb-eyer merged commit 7515510 into master Aug 26, 2017
@lucasb-eyer lucasb-eyer deleted the faster-fast branch August 26, 2017 22:08
@lucasb-eyer
Copy link
Owner Author

Oh, thanks for pointing out the typo, I missed that comment! Will fix in master.

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

Successfully merging this pull request may close these issues.

2 participants