Replies: 1 comment 1 reply
-
Yes.
Wand's
That would be the correct way to export raw pixel data.
Very possible on modern hardware. Each export will have a value between 0.0 & 1.0 with different memory allocations. If I remember correctly, the values are calculated by something like...
Don't waste time with floats. If HDRI is important, ensure ImageMagick is compiled with HDRI support, and export to the outputArray = img.export_pixels(0, 0, imgWidth, imgHeight, "RGBA", "quantum")
outputArray *= wand.version.QUANTUM_SCALE # Convert values between 0.0 & 1.0
Not all hardware architecture may support this. As long as Python's |
Beta Was this translation helpful? Give feedback.
-
Is this intended?
When reading processed image data from Wand back to Numpy array, I've noticed the following:
outputArray = numpy.array(img, dtype=numpy.float32)
treats image data as uint8 bytes, so it's useless when image has HDR float32 dataexport_pixels()
which hasstorage
argoutputArray = img.export_pixels(0, 0, imgWidth, imgHeight, "RGBA", "float")
outputs data as float64, exactly likeoutputArray = img.export_pixels(0, 0, imgWidth, imgHeight, "RGBA", "double")
outputArray = numpy.array(img.export_pixels(0, 0, imgWidth, imgHeight, "RGBA", "float"), dtype=numpy.float32)
Wouldn't it be better to treat STORAGE_TYPES.float as float32 instead of it being redundant copy of STORAGE_TYPES.double?
Beta Was this translation helpful? Give feedback.
All reactions