Skip to content

Commit

Permalink
Merge pull request #2336 from TooSchoolForCool/main
Browse files Browse the repository at this point in the history
[BUG] fix rounding issue in uv_to_color()
  • Loading branch information
mikedh authored Jan 2, 2025
2 parents 8d4693c + 5b580b6 commit c46eca1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion trimesh/visual/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,8 @@ def uv_to_color(uv, image):
# access colors from pixel locations
# make sure image is RGBA before getting values
colors = np.asanyarray(image.convert("RGBA"))[
y.round().astype(np.int64), x.round().astype(np.int64)
y.round().astype(np.int64) % image.height,
x.round().astype(np.int64) % image.width
]

# conversion to RGBA should have corrected shape
Expand Down

0 comments on commit c46eca1

Please sign in to comment.