Decimal places in RGBA values of Python-generated image? I wrote a Python script to generate several image textures for use in Image Texture nodes. All the calculations yield values with many decimal places (some being on the order of 1e-7). 

Printing the results of the calculations themselves to the console shows the values in full (or at least sufficient) precision. Printing the RGBA values of the generated image pixels for the image texture node, however, shows only one decimal place—with minuscule values being reduced to 0.0. 

For this particular image texture node, this precision is not just a matter of display on the console. It really does seem that the RGBA values are 0.0. I say this because scaling the output of the Image Texture node by 1e7 has no effect (on color strength, which the node serves to control); yet, adding a 1e-7 to the output and then scaling suffices to get a nonzero color strength.

I figure that somewhere between the calculations themselves and the storing of the results in the generated image pixels, something is happening. This seems true: printing the RGBA values of the pixel entries in the generated image itself shows 0.0s instead of the small numbers I saw when printing the calculation results. 

I'll post more detail if needed, but does anyone know why this might be happening? I should note that this kind of rounding doesn't seem to be happening for a different image texture file (whose values have many decimal places, though all are sizable fractions between 0 and 1, as opposed to being on the order of 1e-7).

Thanks in advance!
Images are usually created and packed as PNGs as 8-bit sRGB format. This severely limits the precision of the RGBA values stored. To improve precision you need to force the image to be stored in a format that supports 32-bit float channels such as EXR format.

To use a simple example, storing as an 8-bit image would be limited to steps of 1/256 or approximately 0.0039 - any value below around 0.002 would be rounded down to zero and any value from 0.002 to around 0.006 would be rounded to 0.004 (or 00000001 in binary). The actual values used for each 'step' is further complicated by the sRGB color conversion (which stretches the color space in order to produce a more practical range of colors for display on a screen - see Wikipedia sRGB

Examples of storing images in 32-bit float EXR format can be found in Creating and packing a 32-bit float image and Capture object properties to use in a Cycles material