Generate gradients based on the images colors.Extract the dominant color from an image.From a simple plain color, based on the dominant color, to a beautiful gradient based on the image edges colors, colorify.js will spice up your designs. ( can i use, compatibility table)Ĭolorify is a script written in Javascript, that allows you to extract colors from images, and manipulates them.It is highly customizable and depends on the following browser functionalities: The colors method expects either a DOM element of an image or a URL to the image: var img = document.getElementById('image') Ĭonsole.log('Dominant color:', payload.dominant) Ĭonsole.log('Secondary color:', condary) Ĭonsole.log('Palette:', payload.palette) RGBaster is a very simple javascript library for extracting the dominant color(s) from an image. Anyway, it's really faster than the Flash version. You only need to make sure that jQuery and are included in your web page. So imgcolr based on HTML5 just supports latest modern browsers like Google Chrome and Firefox. Imgcolor is unique in the sense that it supports HTML5 and Flash, as with third party images you will get the CORS Exception in HTML5 by browser vendors. `color` is the grabbed color, a string like "#ededed" `img` refers to the current img element Its usage is very simple: var imgs = $('img') Note that imgcolr can not handle images with colorful borders properly. Based on the idea, you can make the web more beautiful and interesting. You can programmably adapt the elements' color on the webpage for the image after getting the color. Imgcolr is a jQuery plugin for grabbing the dominant color of a given image's borders. You can use such a feature to implement for example a color adapting UI according to the profile picture of the user or other crazy things.Įnjoy our top of 5 from the best color extraction plugins written in Javascript. However, Some developers have taken the time to write useful plugins that make the implementation of this feature really easy and straightforward as every plugin for Javascript. The task of extract the color from an image with Javascript, is surely not an everyday task (usually).