mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
fix luminance computation
This commit is contained in:
parent
a376d0e4d1
commit
b3d7887d4d
@ -99,8 +99,8 @@ class ImageReader(MeshReader):
|
|||||||
for x in range(0, width):
|
for x in range(0, width):
|
||||||
for y in range(0, height):
|
for y in range(0, height):
|
||||||
qrgb = img.pixel(x, y)
|
qrgb = img.pixel(x, y)
|
||||||
avg = float(qRed(qrgb) + qGreen(qrgb) + qBlue(qrgb)) / (3 * 255)
|
luminance = (0.2126 * qRed(qrgb) + 0.7152 * qGreen(qrgb) + 0.0722 * qBlue(qrgb)) / 255 # fast computation ignoring gamma
|
||||||
height_data[y, x] = avg
|
height_data[y, x] = luminance
|
||||||
|
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user