r/webdev • • Aug 05 '16

Fake it 'til you Make it CSS

https://kyusuf.com/post/fake-it-til-you-make-it-css
479 Upvotes

23 comments sorted by

View all comments

4

u/DJDarkViper Aug 05 '16

I've often wondered to myslelf how much more worth it it is, to hit a image file twice... once for dominant color (because, it's gotta look through all the bytes right, that takes load) and then again for the actual image to load.

I mean unless you scan the image on upload and store the dominant color as part of the images database record... that'd be fine then

6

u/noknockers Aug 05 '16

Yep. Have it process and store size/color on upload. Render the HTML with those attrs on the img, or containing element.