mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
fix luminance computation
This commit is contained in:
parent
a376d0e4d1
commit
b3d7887d4d
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue