feat: irradiation compensation for dark backgrounds#24
Merged
Conversation
9be4eb9 to
e2d8b7c
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
a57b4aa to
ba81b76
Compare
Light content on dark backgrounds appears larger due to the optical irradiation illusion. Apply a small scale-down (up to 5%) proportional to how dark the detected background is. Exposes backgroundLuminance (Rec.601) on MeasurementResult for opaque images. Transparent images are unaffected.
Scale compensation by darkness × density × 0.08 instead of flat 5%. Denser logos get more compensation (more surface area blooms). Thin wordmarks get less. Based on Helmholtz irradiation research.
ba81b76 to
715acbc
Compare
Benchmark Comparison: main vs feat/irradiation-compensationThreshold: 5%+ change, >100us absolute delta, and statistically significant (p<0.05).
No regressions detected. Feature cost breakdownHow expensive are individual features? Measured on this run's HEAD commit.
Full benchmark output in the CI job logs. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Light content on dark backgrounds appears larger/bolder due to the irradiation illusion. Compensation scales by
darkness × density × 0.08— denser logos get more correction, thin wordmarks get less.Exposes
backgroundLuminanceonMeasurementResultfor opaque images. Transparent images are unaffected.Usage
Automatic for opaque images with detected dark backgrounds. For transparent logos on a known dark page, opt in via
backgroundColor:Compensation is applied automatically — no additional props needed. To disable, set
densityAware={false}.References
Stacked on #23.