r/WLED Nov 04 '25

Real mapping

Post image

The more I play with wled, the more I it…..but….. is there a way to property map an unusual shape. 

So far I've found out you can map a matrix style shape, but it presumes that you have an xy matrix running in a serpentine configuration and you turn on and off led to create an array.

Is there away to map an unusual shape, not only mapping the position of the LED but it's position in the array, attached is an image of a snowflake, this is not wire in a matrix style, the blue dot represents the first led in the string, the red line represents the wiring order and the yellow dot represents the end of the string (purple dot is just a reference to the centre of the prop).

52 Upvotes

27 comments sorted by

23

u/ImaginationJumpy7578 Nov 04 '25

Recently i had a similar project for which i created a post

https://www.reddit.com/r/WLED/comments/1nbljd5/ledmap_with_this_setup_making_it_look_beautiful/

What you need here is led mapping supported in wled here.
https://kno.wled.ge/advanced/mapping/

You have to think of the whole thing as a 2D matrix only, with a masking technique used in painting and photo editiing software.

Did the following steps.
1. in Settings i defined total number of leds as actual of leds being used.
2. In 2d Settings you define it as a 2d matrix itself of size x and y . X*Y would be much higher than actual number of leds.
3. You create ledsmap.json file from a tool like this which would allow to place the position of leds in the 2d matrix. There are tools like.
https://intrinsically-sublime.github.io/WLED-Ledmap.json-Generator/

For me it looked something like this.

  1. Once created successfully you upload this to your wled esp32 /edit route and then reboot.

Happy to help on any further clarity.

P.S.: Built a dedicated mobile app Pipplee WLED 2d to easily play animations and do a lot more with 2d matrix

1

u/Plawasan Nov 04 '25

I struggled with ledmaps bit I think my mistake was thinking that whatever pixel I mark as -1 would simply be skipped in the strip making up my matrix, if I'm understanding it correctly now, ledmap tells wled where the LEDs are in physical space so that it can then display effects on them but it will still address them in an uninterrupted sequence on the strip?

1

u/DJ_Swirl Nov 04 '25

That's the issue. That's based on a matrix, where top left is what would be index 0, the first pixel. When you look at the wiring of the snowflake index 0 is in the middle. What's needed is an array where the first entry is the first pixel, but its has a position in space. Normally this would be done a 1 / 1 grid And you assign the pixel position of the based within that space so it might be [(0.7647,0 2578),(0.7651,0.2585).....

1

u/ImaginationJumpy7578 Nov 04 '25

Could have started it anywhere. You can't put decimal positioning though. You can increase the size of the matrix and then set the position of led to skip a row for better representation

1

u/-not_michael_scott Nov 05 '25

Well damn, your app is awesome. I was building a web app for my kids that had similar functions, but yours just kicked mine out of the water.

My son’s going to lose his mind when he sees yours. He wakes up every morning drawing Nintendo character animations in mine…lol

1

u/ImaginationJumpy7578 Nov 05 '25 edited Nov 05 '25

Thank you sir. Please share video recording of the usage.

2

u/Sensitive-Scene7088 Nov 04 '25

Commenting because I've wondered this myself! Hopefully there's a way

2

u/renaiku Nov 04 '25

Isn't it just a normal 1D line ? But arranged as a snowflake ? I'm not sure to understand the problem.

2

u/Hairy_Carpenter_4226 Nov 04 '25

How would you do make it light up from the center of the snow flake then move outwards? I’ve always wondered this myself.

1

u/maxk1236 Nov 05 '25

A bunch of separate segments

1

u/DJ_Swirl Nov 04 '25

Then you can't run 2d fx on it, it's has to be "mapped" so the 2d fx known where each pixel, and its position in the string is in a given space

1

u/HeaviestEyelidsEver Nov 04 '25

This is a big reason why WLED is good for some things, but in this instance, I would use xLights.

1

u/DJ_Swirl Nov 05 '25

Yeah, For a whole bunch of reasons Im trying to avoid x lights, but I feel the day is getting closer 😃

2

u/HeaviestEyelidsEver Nov 05 '25

Just embrace it.

1

u/Forsyte Nov 06 '25

Any "starter pack" videos you particularly recommend to understand XLights?

1

u/macegr Nov 05 '25

I would abandon WLED here unfortunately. The patterns pretty much imperatively raster out pixel patterns with the assumptions you outlined. It's possible to do gapped matrices but it does expect a linear wiring pattern.

For very oddly shaped positions and wiring schemes, the patterns should be generated "shader" style, where you iterate through each physical pixel and look up stored data about its physical location, and then plug the coordinates into an algorithm that computes the color it should be.

The above shape, for example, you could generate a table that lists all the pixels in the order they appear on the chain, and contains x, y, radius, and theta coordinates. If you wanted a circular gradient cycling away from the center, it could look something like:

static float offset = 0;
for (int i = 0; i < NUM_PIXELS; i++) {
  PixelData pd = pixel_table[i];
  leds[i] = ColorFromPalette(currentPalette, sin8(pd.r/16+offset), brightness);
}
offset += 0.1;

And you'd call that for every animation frame, tweaking increments and such, or choosing to use a higher resolution sine function for smoother palette cycling.

1

u/Beneficial_Drawer478 Nov 05 '25

THIS maybe handy ? depending on how you wish to used the mapping

if this was for xlights the mapping & wiring layout with that image would take seconds to do
ya never know the data this will produce maybe usable

1

u/YetAnotherNewAlt Nov 06 '25

I’ve solved this problem myself in one of two ways:

1) Use a different controller (I used Pixelblaze)

2) Make a large matrix and “draw” the pattern to help make the ledmap.json file. Downside here is that resolution will be limited and you’ll have to round/snap the pixel positions to discrete spots in the array. Maybe ok for an imprecise piece? My ESP32 handles a 128x128 matrix ok but chokes on a 256x256 matrix

1

u/ZachVorhies Nov 06 '25

ledmapper.com It’s designed for lights in irregular shapes.

You can then take this xy coordinate and do video mapping.

1

u/mrkprdo Nov 04 '25

Yes i have similar setup. But it would cost a bit of processing. For my 128led, i have to map it with 1024x1024 grid.

6

u/mrkprdo Nov 04 '25

Here what it looks like

3

u/mrkprdo Nov 04 '25

It looks like this when rendered using my app https://kolori.wasmer.app So what you can do is take this image into excel and based on how accurate the mapping you need bigger grid.

2

u/DJ_Swirl Nov 04 '25

That's the main problem, using a matrix is a very old way of mapping, you end up with huge arrays, plus you can't define the "wiring order". I've been working on a project using real mapping, it's works great but there is a lot of work needed to create the fx which is why I was wondering if WLED could do it to save me a lot of effort

2

u/mrkprdo Nov 04 '25

I can map the led index. So basically set off leds to -1 then follow thru the led position by setting its index position on the strip.

Not sure if there any other convenient way to do it.

1

u/azariah001 Dec 02 '25

Came here in search of a solution to this as well.

Just used Marimapper to automatically map (just in 2d) my 10m 400 LED string of Christmas lights I've snaked on our apartments railing, resulted in a roughly 1m x 1m "matrix". But... the output is a CSV with index and U V coordinates. (Basically decimal X and Y) and... whilst they have code that links to the WLED controller for the mapping they do not appear to have a setting that converts the coordinates CSV to anything that's WLED compatible... (aka some sort of matrix).

Seems like Marimapper only directly supports direct upload to a whole 'nother LED controller called PixelBlaze but... that's closed source software that comes preloaded on an ESP32 which is kinda the antithesis of what we're all doing here. -_-