Command line: how to rebuild RGB from scalar fields after filtering?

Feel free to ask any question here
Post Reply
Radim
Posts: 5
Joined: Fri Jan 16, 2026 9:16 am

Command line: how to rebuild RGB from scalar fields after filtering?

Post by Radim »

Hi all again :-),

I’m following up on this thread about the new -FILTER -RGB -SF ... command introduced in CloudCompare v2.14 beta (thanks again for pointing me to it). I’m trying to build a fully automated pipeline.

My goal:

I want to reproduce this workflow from the GUI in a command-line pipeline:
1.Take a colored point cloud and convert RGB to scalar fields (R, G, B)
2.Apply Bilateral filter on each channel separately (R, then G, then B) as scalar fields
3. After filtering, rebuild RGB from the filtered scalar fields
4. Equivalent to GUI: Edit → Colors → From scalar fields (map filtered R/G/B back into RGB)

What I can do from CMD (works)
With v2.14 beta I can do these steps from the command line:
Load LAZ
-RGB_CONVERT_TO_SF
-SET_ACTIVE_SF ...
-FILTER -SF -BILATERAL ... (per channel)

So the filtering part is available now, which is great.

Where I hit limits / what seems missing
I’m currently stuck on the “SF → RGB” part (step 3–4 above), i.e. the CLI equivalent of: (Edit → Colors → From scalar fields)...

So i want to ask...
Is there currently any CLI command that replicates “Colors → From scalar fields”?
(Map 3 scalar fields back into RGB, optionally with clamping/scaling.)
If not, is this functionality planned to be exposed in the CLI (since the GUI feature exists)?

Any guidance on the best way to implement this pipeline would be really appreciated.

Thanks a lot!

Radim
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Command line: how to rebuild RGB from scalar fields after filtering?

Post by daniel »

Isn't it the -SF_CONVERT_TO_RGB method? (in conjunction with SET_ACTIVE_SF)
Daniel, CloudCompare admin
Radim
Posts: 5
Joined: Fri Jan 16, 2026 9:16 am

Re: Command line: how to rebuild RGB from scalar fields after filtering?

Post by Radim »

Hi Daniel,

thanks for the suggestion. I initially thought that -SF_CONVERT_TO_RGB might correspond to this workflow, but I now realize I may have mixed up two different tools.

What I’m actually trying to reproduce in the CLI is the GUI tool described here:
https://cloudcompare.org/doc/wiki/index ... lar_fields

Specifically, I’m aiming for this pipeline:

RGB → scalar fields (R, G, B)

Apply a bilateral filter separately on each channel (as scalar fields)

Then map the filtered R, G, B scalar fields back into the RGB channels
(equivalent to Edit → Colors → From scalar fields, not Scalar fields → Convert to RGB).

From my understanding, -SF_CONVERT_TO_RGB converts one active scalar field to colors using the current color scale, whereas ("Colors → From scalar fields") assigns individual RGB components from multiple scalar fields.

If I’m missing something and -SF_CONVERT_TO_RGB can already do this multi-channel mapping, could you please clarify how?
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Command line: how to rebuild RGB from scalar fields after filtering?

Post by daniel »

No you are correct, the 'Colors from scalar fields' method is much more involved, and would be hard to transfer to the CLI mode. Unless you have very simple parameters I guess. Anyway, nobody has taken in charge this work yet.

Also, I don't know if this tool is available via the CloudCompy (python) interface? (you'll have to ask on the project's github page though, as it's a separate project: https://github.com/CloudCompare/CloudComPy)
Daniel, CloudCompare admin
Radim
Posts: 5
Joined: Fri Jan 16, 2026 9:16 am

Re: Command line: how to rebuild RGB from scalar fields after filtering?

Post by Radim »

Thanks Daniel, understood.
Thanks as well for the quick and clear reply...I’ll check CloudComPy on GitHub as suggested.
Post Reply