Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change color of background based on image main color?

I don't know if this is actually possible but it would be nice if it is! Taaking inspiration from the new iTunes where the background color seems to be set via the (major) color of the artwork image. I'm looking to do something similar with javascript/cs maybe using jQuery, essentially changing the background-color of a div based on an image inside it.

like image 860
user2279722 Avatar asked Apr 14 '13 14:04

user2279722


People also ask

Can we change background of photo from blue to white?

One-Click Background Color Changer It can be difficult and time-consuming to change background color in Photoshop. Luckily, with Fotor's background color changer, it takes only one click to change an image's background color. Simply upload your image, and Fotor will automatically remove background from image.


1 Answers

Here's what you could try out:

https://github.com/lokesh/color-thief

This library has a pretty cool demo: http://lokeshdhakar.com/projects/color-thief/

Found here: Get average color of image via Javascript

like image 148
ndrizza Avatar answered Sep 18 '22 13:09

ndrizza