# How to register a pixel mapper cleanly (file-wise)?

**URL:** <https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143>\
**Category:** Uncategorized\
**Created:** [November 14, 2025, 1:39am UTC](https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143 "2025-11-14T01:39:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![deadlift89](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deadlift89](https://rpi-rgb-led-matrix.discourse.group/u/deadlift89)\
**Post date:** [November 14, 2025, 1:39am UTC](https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143/1 "2025-11-14T01:39:42Z")

</div>

Is there an elegant way to register custom pixel mappers globally without hacking or modifying any internal code or C++ build params within `rpi-rgb-led-matrix` directly? I also don’t want to have to import and register the pixel mapper within each individual’s display program. I’d like it to be recognizable from the command-line flags. I have a mixture of Python and C++ written display programs and they live in a separate folders like this:

- `project_root`
  - `rpi-rgb-led-matrix`(git)

  - `src`

  - `views`

With this directory layout is it possible to register `pixel-mapper-custom.cc` without modifying the git repo `rpi-rgb-led-matrix` directly?

I see there is `ApplyPixelMapper`which seems to require initialization in each individual view program, and also `RegisterPixelMapper`for global use - but I’m not sure where to use this second function when starting an individual Python or CC program from Bash. My code starts each individual display program directly from their own file. How in the build/init step can it be aware of how to find the `pixel-mapper-custom.cc` file and run `RegisterPixelMapper`?

---

<div class="post-metadata">

**Author:** ![marcmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/marcmerlin/32/40_2.png) [@marcmerlin](https://rpi-rgb-led-matrix.discourse.group/u/marcmerlin)\
**Post date:** [November 27, 2025, 6:44am UTC](https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143/2 "2025-11-27T06:44:09Z")

</div>

I don’t believe there is any plugin method for mappers, I modified the code directly to add mine.

---

<div class="post-metadata">

**Author:** ![marcmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/marcmerlin/32/40_2.png) [@marcmerlin](https://rpi-rgb-led-matrix.discourse.group/u/marcmerlin)\
**Post date:** [November 28, 2025, 7:19pm UTC](https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143/4 "2025-11-28T19:19:14Z")

</div>

this sounds like the correct way to do things, so if you can build a nice PR, that would make things better for sure.  
Please do have a look at this panel mapper that just landed though:

> **[rpi-rgb-led-matrix/lib at master · hzeller/rpi-rgb-led-matrix](https://github.com/hzeller/rpi-rgb-led-matrix/tree/master/lib#feature-remap-mapper-experimental)**
>
> Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO - hzeller/rpi-rgb-led-matrix

> <https://github.com/hzeller/rpi-rgb-led-matrix/pull/1478>
>
> (for discussion, needs some polishing, needs testing)
> 
> This PR implements univ…ersal mapper - each segment is mapped to arbitrary position and orientation on canvas
> 
> My use case is two separate displays connected as chains, each with different geometry. But it shall handle almost all possible panel configuration
> 
> Syntax is:
> \`\`\`
> \--led-pixel-mapper='Remap:\<new\_width\>,\<new\_height\>|\<panel0\_x\>,\<panel0\_y\>\<panel0\_orientation\>|\<panel1\_x\>,\<panel1\_y\>\<panel1\_orientation\>'
> \`\`\`
> new\_width, new\_height - size of created canvas. It can be both larger and smaller than old canvas.
> panel0\_x, panel0\_y - upper-left corner of remapped panel
> panel0\_orientation - \`n\`,\`s\`,\`e\`,\`w\` for panel orientation, \`x\` to discard panel
> 
> Exactly one entry must be specified for each LED panel (chain \* parallel entries). 
> Mapping may be partially outside new canvas (maybe useful for something?)
> Unused positions must be discarded (\`0,0x\`) - useful if chains are of different length
> It is possible let some canvas space unused (no panel mapped to it). Writes to this area will be ignored.
> 
> For example:
> \`\`\`
> --led-cols=16 --led-rows=8 --led-chain=5 --led-parallel=2 --led-pixel-mapper='Remap:40,32|0,0e|8,0e|16,0e|24,0e|32,0e|0,16n|16,16n|0,24n|16,24n|0,0x'
> \`\`\`
> First chain is 5 panels in line, top of the panel is pointing right, 40x16 pixels
> Second chain is 2x2 square, panels pointing up, 32x16 pixels, top-left is 0,16 in canvas
> Last panel on second chain is not used
> \`\`\`
> 1 2 3 4 5
> 1 2 3 4 5
> 6 6 7 7 
> 8 8 9 9
> \`\`\`
> 
> I'll add some documentation if there is interest in this feature

For pixel mappers within a panel, there is no plugin, they just get added one at a time.  
I’m thinking those pixel mappers should be added to the code like they are now, because they are useful for everyone.

Mappers for layouts between panels are indeed more personal and one-off. If the one I just gave you is not good enough, having another plug in option would be good, or maybe you can further extend the one that just got added.

---

<div class="post-metadata">

**Author:** ![marcmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/marcmerlin/32/40_2.png) [@marcmerlin](https://rpi-rgb-led-matrix.discourse.group/u/marcmerlin)\
**Post date:** [December 1, 2025, 4:15pm UTC](https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143/7 "2025-12-01T16:15:37Z")

</div>

Please do. I had time to merge it but not to test it personally, yet.

Also feel free to tag me via @marcmerlin when you answer, I’ll see your answer more quickly

---

<div class="post-metadata">

**Author:** ![board707](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@board707](https://rpi-rgb-led-matrix.discourse.group/u/board707)\
**Post date:** [December 3, 2025, 12:12pm UTC](https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143/9 "2025-12-03T12:12:06Z")

</div>

> [@deadlift89](#):
>
> I thought my panel arrangement was too strange

Very interesting. Could you dive in more detail?

---

<div class="post-metadata">

**Author:** ![marcmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/marcmerlin/32/40_2.png) [@marcmerlin](https://rpi-rgb-led-matrix.discourse.group/u/marcmerlin)\
**Post date:** [December 7, 2025, 9:56pm UTC](https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143/11 "2025-12-07T21:56:20Z")

</div>

a picture would make this more obvious.

Also please check the new universal programmable mapper that was checked in a week ago

---

<div class="post-metadata">

**Author:** ![marcmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/marcmerlin/32/40_2.png) [@marcmerlin](https://rpi-rgb-led-matrix.discourse.group/u/marcmerlin)\
**Post date:** [December 8, 2025, 6:01am UTC](https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143/13 "2025-12-08T06:01:24Z")

</div>

aaah, got it., and yes the picture helps.  
Glad to hear the new mapper is helping you.  
That said, don’t you want to use 3 channels to triple your refresh rate?

---

<div class="post-metadata">

**Author:** ![marcmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/marcmerlin/32/40_2.png) [@marcmerlin](https://rpi-rgb-led-matrix.discourse.group/u/marcmerlin)\
**Post date:** [December 17, 2025, 7:02am UTC](https://rpi-rgb-led-matrix.discourse.group/t/how-to-register-a-pixel-mapper-cleanly-file-wise/1143/16 "2025-12-17T07:02:26Z")

</div>

You want this board, I worked with them to get a smaller board for rpi0 2w  
[https://www.electrodragon.com/product/rpi-passive-3ch-rgb-matrix-drive-board-v0/](https://www.electrodragon.com/product/rpi-passive-3ch-rgb-matrix-drive-board-v0/)
