From 6c3daa8c6e87880b466d1375672d5df2d27f5f81 Mon Sep 17 00:00:00 2001 From: Mark Steward Date: Sun, 28 Jun 2026 02:25:15 +0100 Subject: [PATCH] Truncate when dividing to avoid LossySetitemError --- src/pyntcloud/io/las.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyntcloud/io/las.py b/src/pyntcloud/io/las.py index 5d2528d..3447531 100644 --- a/src/pyntcloud/io/las.py +++ b/src/pyntcloud/io/las.py @@ -56,7 +56,7 @@ def convert_color_to_dtype(data, output_dtype): column_max_values = data["points"].loc[:, column_names].max() # Do not scale color values restricted to [0, 255] if column_max_values.to_numpy().max() >= 256: - data["points"].loc[:, column_names] /= 256 + data["points"].loc[:, column_names] //= 256 data["points"] = data["points"].astype( {"red": output_dtype, "green": output_dtype, "blue": output_dtype} )