NormalizeColor#

class NormalizeColor[source]#

Bases: object

Scale per-point colors from [0, 255] into [0, 1].

Reads and overwrites data_dict["color"] in place by dividing it by 255. A no-op when no "color" key is present. Registered as NormalizeColor — use this string as the type in a transform=[...] config list.

Example

>>> import numpy as np
>>> data = {"color": np.array([[0., 128., 255.]], dtype="f4")}
>>> NormalizeColor()(data)["color"].round(3)
array([[0.   , 0.502, 1.   ]], dtype=float32)  # divided by 255 -> [0, 1]