fix luminance computation

This commit is contained in:
Tim Kuipers 2019-05-20 12:08:16 +02:00
parent a376d0e4d1
commit b3d7887d4d

View File

@ -99,8 +99,8 @@ class ImageReader(MeshReader):
for x in range(0, width):
for y in range(0, height):
qrgb = img.pixel(x, y)
avg = float(qRed(qrgb) + qGreen(qrgb) + qBlue(qrgb)) / (3 * 255)
height_data[y, x] = avg
luminance = (0.2126 * qRed(qrgb) + 0.7152 * qGreen(qrgb) + 0.0722 * qBlue(qrgb)) / 255 # fast computation ignoring gamma
height_data[y, x] = luminance
Job.yieldThread()