Questions tagged [color-thief]
Questions about color-thief, a library in JavaScript for extracting the main colors from images.
27
questions
0
votes
0answers
14 views
ColorThief AWS S3: Unsupported file type: binary/octet-stream
I'm trying to get the color palette of an image hosted in a AWS S3 Bucket. But getting this error Unsupported file type: binary/octet-stream
await ColorThief.getPalette('link to aws s3 bucket.png', 5)
...
0
votes
1answer
49 views
ColorThief.getColor() TypeError: url.indexOf is not a function
I'm trying to use ColorThief in the node.js environment. When invoking ColorThief.getColor() I get the follwing error:
TypeError: url.indexOf is not a function
The error results from this line of ...
0
votes
0answers
44 views
ColorThief react library not rendering
I'm using ColorThief library in react. Here's my code:
import Color from 'color-thief-react';
mappedPopularBooks = Object.keys(popularBooks).map(key => {
var book = ...
0
votes
1answer
108 views
Node.js: Why does pure black (#000000) get detected as RGB 4, 4, 4?
I have used node-vibrant, get-image-colors, colorthief, all of them detect #000000 as RGB 4, 4, 4. Image here. Just took a picture of an empty portion of the Command Prompt.
The code I've provided ...
1
vote
1answer
144 views
Is there possible way to detect the color by using ColorThief which is uploaded from Dropzone?
I used react-dropzone for image upload and I got “file name” and “preview” for each uploaded item from the dropzone.
And I would like to use ColorThief for detecting the uploaded image of colors. ...
-1
votes
1answer
354 views
ColorThief.getColor is not a function
So, i'm trying to get my dominant color from color thief. But i'm constantly getting this error:
Here is my code that I took from the official documentation
var ColorThief = require('colorthief');
//...
0
votes
0answers
133 views
Getting a pixel color in fullscreen games using Python
Im a Python beginner trying to get the most dominant color (using the ColorTheif module) from a fullscreen game and outputting the RGB values to a text file.
Here is what I've got so far: (not ...
0
votes
0answers
66 views
Color Thief usage on Wordpress with external images
I need to apply a dominant color for the background of an image container in wordpress but I found that Color Thief does not work (it works on a normal web page but not in Wordpress).
This effect ...
0
votes
2answers
203 views
Color-Thief Node plugin error: “Image given has not completed loading”
Working in Node/Express, I was trying to get the npm package color-thief to grab the dominant color from an image, and it failed because "image given has not completed loading".
The image was, again, ...
1
vote
0answers
64 views
How i can specify the number of extracted colors in a image with color-thief javascript library?
I want to extract the color of a photo but extract if is posible 26 color, one color for every alphabet letter for a grapheme-color synesthesia ebook reader experiment.
Thanks!
0
votes
3answers
993 views
Get color palette from animated GIF with Pyhton PIL
I'd like to get the color palette of each frame of an animated GIF (I'm using ColorThief to generate color palette from an image).
I'm using PIL to save each frame as an image, my problem is that the ...
-1
votes
1answer
243 views
Implementation of Lokesh Dhakar's “Color Thief” library results in “Uncaught TypeError: Cannot read property '0' of null”
I am trying to implement Lokesh Dhakar's "Color Thief" library.
The expected outcome is to display dominant color and color palette immediately after upload.
My assumption is that there is going ...
4
votes
1answer
195 views
Apply results on each, keeps overriding
I am using color-thief js to get the color of each image inside a div. I am trying to loop through each and retrieve colors. This works fine. In my console, it shows the colors for each image.
I ...
0
votes
2answers
1k views
Using Color Thief Library in React doesn't work
I am struggling to add Color Thief in a react app. I have followed the instruction on github but nothing changes.
I have applied the suggestions reporte here and then inserted the scripts inside a ...
2
votes
2answers
488 views
ColorThief returning wrong dominant color
In my UWP app we have images that users upload and they can be pretty much any size - so when I load these into in an Image control I resize them proportionally so they fit best into our image ...
1
vote
0answers
46 views
ColorThief library is not producing same colors for a single image on different platforms
ColorThief library is available for Javascript, Java, Android and iOS but it is not producing the same colors for a single image on all 4 platforms.Has anybody faced the same issue with this library?...
1
vote
0answers
40 views
onload in for loop returning only the last item (JS) [duplicate]
my code goes like this:
setTimeout(() => {
var colorThief = new ColorThief();
var imgObj = new Image();
var count = 0;
for (i = 0; ...
1
vote
1answer
177 views
Color Thief Not Changing Background
My first time working with Color Thief and I can't seem to get a background of a div to change its background color after checking the dominant color of an image. Here is the code I'm working with ...
-1
votes
2answers
177 views
Colored Shadow by Color Thief
I'm trying to make a shadow of an image using Color Thief (like the image below):
I'm trying to make Color Thief detect the color and make the shadow look like the shadow colored by the color that ...
0
votes
1answer
519 views
Color-thief.js Cannot read property 'width' of undefined
I'm struggling to make color-thief works, I think that my code is right so, I don't understand if it comes from the color-thief script or mine.
Here's my code so far :
<!doctype html>
<...
1
vote
0answers
669 views
Dynamic Color-Thief / Get dominant color
I have a very special problem with color-thief. I'm trying to load some data from my datatable containing a realtive path to a image stored on the same domain.
There are about 20 links where I have to ...
0
votes
1answer
448 views
How to Use Color Thief With UWP
I loading images source from internet and I need this images dominant color. Forexample this image and then found color thief but I cant understand.
I using this method but I think it's wrong.
...
2
votes
2answers
510 views
How to change this javascript code to show a modified image?
I am playing with image color quantization algorithms. I have found this link
Color Thief
where a javascript (a language that I have never studied) implementation of a modified median cut algorithm is ...
2
votes
2answers
119 views
Javascript average colour of img displayed on mulitple backgrounds
As you can see below I am trying to write a program that will take the average colour of an image and then display it as the background of the parent class where the img is in.
Each image is stored ...
0
votes
0answers
165 views
colourthief.getColorFromUrl error on chrome
I am using this GitHub project: github.com/lokesh/color-thief
The aim is to get the overall colour of an image stored internally on the server and set it as the background.
I created this test page ...
3
votes
1answer
262 views
This jQuery each() loop keeps returning the last color only (Color Thief)
Using the Color Thief javascript effect, I have written some code that grabs an images dominant color and adjusts the entire theme's color scheme based on the image.
This all works well on a single ...
2
votes
1answer
359 views
Canvas & Color-Thief image index size
I'm using color-thief to analyze the colors of images. I'm using a canvas and getImageData, I'm getting the following error message in the console:
Error: Index or size is negative or greater than ...