But, like the many other custom ROM features, the brightness slider feature is not available on the stock ROMs. This feature allows you change the brightness level of your Android device simply by sliding your finger across the status bar. One of these handy features is the brightness slider in the status bar. If you’ve ever tried a rooted phone with a custom ROM, surely you must have come across various handy features that you can’t find on the Stock ROMs. Note that it passes through (0, 0) and has a small kink at output value 0.5 (magnified in the second image for clarity), just like TJ’s experimental measurements.Android is a platform where many developers come out and showcase their ideas aimed to improve the ability of the system. The blue curve below represents this transformation. This transformation patches together a gamma-curve (yes, that gamma) and a logarithmic curve to approximate actual human brightness perception. The inline comments indicate that these functions are derived from the Hybrid Log-Gamma transformation. Public static final int GAMMA_SPACE_MAX = 1023 // Hybrid Log Gamma constant values private static final float R = 0.5f private static final float A = 0.17883277f private static final float B = 0.28466892f private static final float C = 0.55991073f public static final int convertGammaToLinear ( int val, int min, int max ) ![]() In particular, we can see that the curve does not pass through (0, 0) (arrow 1), deviates noticeably from measured values in some regions (arrow 2), and fails to capture a strange flat section of measured values (arrow 3): Android’s slider input values and display brightness setting values are both discretized (represented by integers in the range 0…255).įactor 1 explains why TJ’s logarithmic best-fit curve did not perfectly match the data points he measured.Human perception of brightness is not perfectly logarithmic (and therefore, neither are most brightness transformation functions).This reverse engineering was made difficult by two key factors: In order to keep his brightness-control app DigiLux functioning how users expected, he needed to reverse-engineer the newly-introduced nonlinear relationship between slider input values and display brightness setting values. To match this difference in perception, we updated the brightness slider UI in the notification shade and System Settings app to work on a more human-like scale.Ĭontrols that operate on relatable, “human-like” scales usually lead to simpler mental models and more intuitive user experiences, so this is a great decision! Unfortunately, it made TJ’s life as a developer a little more tricky. That means changes in screen brightness are much more noticeable when the screen is dark versus bright. Humans perceive brightness on a logarithmic rather than linear scale. The brightness control change we’re interested in was motivated and described in an Android Developers Blog post as follows: ![]() Let’s get nerdier in a quest to understand more about this new behavior. This post expands on TJ’s excellent article describing how the brightness control changes in Android Pie practically affect Android developers.
0 Comments
Leave a Reply. |