Determine album art dominant colors to reduce flicker in the interface#9
Merged
Determine album art dominant colors to reduce flicker in the interface#9
Conversation
I noticed in search, in the discographies where it shows many images, they take a few milliseconds to show up, and it makes them flicker into view which is ugly. I already added a grey backdrop, but it's still visible. I wonder if it would help to select a better background color that is more aligned with the thumbnail. Then I got a bit nerd-sniped on extracting that color, and I think I have a good algorithm now. Now we need to run that and store it in the database, and then later we can serve it in the webinterface in the response json. I suspect the reason for the flicker is not loading the image, because they are cached, but either decoding or downscaling it. I suppose the browser evicts it from memory and then has to decode it again. This commit adds an analysis step to the thumbnail pipeline, but it does not do anything with that information yet.
It happens to fit in the Album struct nicely! This is a breaking change that requires recomputing all thumbnails.
Testing with Chromium devtools, caching disabled and severely throttling the network, this works amazingly well! The visual pop when a picture loads is still visible, but scrolling the list now feels much more solid, just the color itself already says so much about the album!
Helix formats it on save, and it's annoying to have to "git add -p" all the time. Time to reformat it.
Better to deal with this at parse time and store things uniformly in the database. This does require repopulating the database.
This ensures that we pick up the thumbnail colors after the thumbs are computed, but also the loudness, which previously was not properly reloaded! That meant that loudness normalization didn't work for new albums if you never restarted Musium or re-scanned the collection!
It interprets the string '413e42' as the number 4.13e+44. Bizarre.
And also the search fix that I implemented as a drive-by now that I had to change that logic anyway.
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.
As described in this toot: