Hi everybody, i'm trying to create a wall led panels but this time by

Hi everybody, i’m trying to create a wall led panels but this time by using a canvas, an ambilight like but replacing the screen with a colored canvas.
My actual problem is color extraction from an image, I can do it manually but it takes a lot of time, is there a soft or tool like “hyperion” to do that ?
So the idea is to create a static “ambilight”

Thanks :wink:

One idea:
If your target array of LEDs is say 16 X 16 LEDs, then you could take the static image in something like Photoshop, scale it down to 16x16 pixels, and save it as BMP. Folks here have done a fair amount with reading BMP files onto LED arrays.

Will this be a one time thing, or are you converting a small batch of images, or are you going to need to convert images frequently/in an automated way?

Hey Mark, thank you for you suggestion
I finally received my printed canvas purchased from Aliexpress, a 141*71cm canvas, I feel I feel the result will be huge
I’ve tried scaling the image with Ps and the result is more than what exepted, i’ve also added some filters to add more contrast, I’ll keep you informed of my progress :slight_smile:

Mehdi.G

https://lh3.googleusercontent.com/-8jK7OGpjz18/Vq9hoiW4q0I/AAAAAAAAAYc/CZ3vEjUzCV0/w529-h274-p/cap.JPG

Hello, I’ve prepared my 211 colors palet with photoshop, and I’m a bit lost on how to create a fixed array of colors, I don’t want an animation for the moment only static colors like the capture i’ve posted on top, Thx

@Mark_Kriegsman Hello, i’m just blocking on how to save an array of hex color values “TProgmemPalette16” “CRGBPalette16” my values looks like : 0x49538E,0x242565,0x362247,0x231609

So FastLED supports palettes of size 16, 32, and 256. If you want to put all 211 colors in one palette, that’ll would have to be one single large 256-entry palette.

I think right now only 16-color palettes can be (automatically) stored in PROGMEM, but that’s not too hard once you have to hex values loaded into your source code.

So, if you just want to define a 16-entry RAM-based (not PROGMEM) palette with hex values, you do this:

const CRGBPalette16 myPalette = {
0x49538E, 0x242565, 0x362247, 0x231609,
0x49538E, 0x242565, 0x362247, 0x231609,
0x49538E, 0x242565, 0x362247, 0x231609,
0x49538E, 0x242565, 0x362247, 0x231609
};

I’ve repeated your example colors four times, but you would just put the actual 16 colors you wanted. Note: no comma after the last hex value.

To define 256-entry palette, it’s almost exactly the same:

const CRGBPalette256 myPalette = {
0x49538E, 0x242565, 0x362247, 0x231609,
0x49538E, 0x242565, 0x362247, 0x231609,
{…continue until exactly 256 colors…}
0x49538E, 0x242565, 0x362247, 0x231609
};

How many LED pixels are there going to be in this piece total, and specifically what kind of microcontroller are you using (e.g. Arduino UNO, Teensy 3.2, etc.) ?

Thx @Mark_Kriegsman , the total of pixels is 211 led (a 141*71 cm) canvas
Right now i’m working on a Ps script to automate pixels values exportation (almost done)
i’ll check the CRGBPalette256 track this evening

Thx again :slight_smile:

Happy to help. What sort of microcontroller are you planning to use? It matters because the amount of memory it has will affect what different options you have here for color storage.

Oops I forgot to answer to that, I’m using an Arduino nano Clone, cheap, small size ect

OK, so you’ve got 2048 bytes of RAM total to work with, and 633 will be taken up with your LED array. A 256-color palette will take up another 768, for a total of 1401 bytes. I suspect it will all fit – but just barely. We may have to Get Clever™.

@Mark_Kriegsman Here is some modification of the example file ColorPalette http://pastebin.com/DydugSjR
when I try to compile the progress bar block and nothing happens :confused:

Do you have “Verbose” messages during compiling turned on? That might help show it.

Also, I see one thing right away: you cannot initialize a 256-element palette with a single call with 256 arguments.

Let me reformulate that a bit…

OK, so here’s that code reformulated a bit
http://pastebin.com/gf7XDbJ3
but as noted before this is going to be VERY tight on RAM this way.

Since you only have ONE color palette for this project (right?) you won’t be switching them around in realtime, and that means we can simplify the code. (Is that right?)

Here’s how to just use a PROGMEM array of hex values directly, and since no 768-byte color palette object is needed in RAM, this should fit easily into the Arduino Nano.

http://pastebin.com/H9hP20xY

The big value of FastLED palettes is mostly being able to make (small) 16-entry palettes that act like (large) 256-entry palettes. Real 256-entry palettes in RAM take up a lot of space, which most Arduinos don’t have.
(The UNO and Nano have just 2048 bytes of RAM total.)

@Mark_Kriegsman Yes i’m using only one color palette, maybe I’ll add some animation at startup but The most important is static colors
I tested the last code you uploaded and the result is really strange some leds are fickering and all colors displayed in the strip are not stored in myColors values :confused:

So lets debug one thing at a time. Try making all the colors in the sketch 0xFF0000 (red) and see what result you get.

Also I’d change the max FPS to “1” not “100”, since you’re not updating the colors at all at this point.

Also can try changing FastLED.delay(…) to just delay(…).

Hello
i’ve tested with 1 fps, changed FastLED.delay to simple delay, and same result
I also modified hex values to red same, and then emptied myColors[] ! same result wich means that the strange colors displayed are not from myColors

Try replacing FastLED.show with just this: FastLED.showColor( CRGB( 32, 0, 0) );

Can you describe what you see?

What if you try CRGB( 255, 0, 0) ?

FastLED.showColor( CRGB( 32, 0, 0) ); all leds are green or red if I change COLOR_ORDER to GRB and CRGB( 255, 0, 0) leds are more bright, normal 255 is greater than 32 :smiley: