Skip to main content
added 1 character in body
Source Link

Although you can't get 0.001 steps, the steps should be 1/255 = 0.0039... Try 1/255*5=0.0196..., or just use 5.0/255.0 to get 5 in the red channel.

This provides a simple test. Replace pixels in bpy image with X/255.0, then you can just hover over the images and see the RGB values, which are all int8 and not float.

show_image(bpy_image):
    pixels = np.multiply(bpy_image.pixels, 255)
    array = np.array(pixels, dtype=np.uint8)
    array = np.reshape(array, (bpy_image.size[1], bpy_image.size[0], 4))
    print(np.shape(array))
    img = Image.fromarray(array)
    imgplot = plt.imshow(img)
    plt.show()

Although you can't get 0.001 steps, the steps should be 1/255 = 0.0039... Try 1/255*5=0.0196..., or just use 5.0/255.0 to get 5 in the red channel.

This provides a simple test. Replace pixels in bpy image with X/255.0, then you can just hover over the images and see the RGB values, which are all int8 and not float.

show_image(bpy_image):
    pixels = np.multiply(bpy_image.pixels, 255)
    array = np.array(pixels, dtype=np.uint8)
    array = np.reshape(array, (bpy_image.size[1], bpy_image.size[0], 4))
    print(np.shape(array))
    img = Image.fromarray(array)
   imgplot = plt.imshow(img)
    plt.show()

Although you can't get 0.001 steps, the steps should be 1/255 = 0.0039... Try 1/255*5=0.0196..., or just use 5.0/255.0 to get 5 in the red channel.

This provides a simple test. Replace pixels in bpy image with X/255.0, then you can just hover over the images and see the RGB values, which are all int8 and not float.

show_image(bpy_image):
    pixels = np.multiply(bpy_image.pixels, 255)
    array = np.array(pixels, dtype=np.uint8)
    array = np.reshape(array, (bpy_image.size[1], bpy_image.size[0], 4))
    print(np.shape(array))
    img = Image.fromarray(array)
    imgplot = plt.imshow(img)
    plt.show()
added 25 characters in body
Source Link

Although you can't get 0.001 steps, the steps should be 1/255 = 0.0039... Try 1/255*5=0.0196..., or just use 5.0/255.0 to get 5 in the red channel.

This provides a simple test. Replace pixels in bpy image with X/255.0, then you can just hover over the images and see the RGB values, which are all int8 and not float.

def show_image(bpy_image): pixels = np.multiply(bpy_image.pixels, 255) array = np.array(pixels, dtype=np.uint8) array = np.reshape(array, (bpy_image.size[1], bpy_image.size[0], 4)) print(np.shape(array)) img = Image.fromarray(array) imgplot = plt.imshow(img) plt.show()

show_image(bpy_image):
    pixels = np.multiply(bpy_image.pixels, 255)
    array = np.array(pixels, dtype=np.uint8)
    array = np.reshape(array, (bpy_image.size[1], bpy_image.size[0], 4))
    print(np.shape(array))
    img = Image.fromarray(array)
   imgplot = plt.imshow(img)
    plt.show()

Although you can't get 0.001 steps, the steps should be 1/255 = 0.0039... Try 1/255*5=0.0196..., or just use 5.0/255.0 to get 5 in the red channel.

This provides a simple test. Replace pixels in bpy image with X/255.0, then you can just hover over the images and see the RGB values, which are all int8 and not float.

def show_image(bpy_image): pixels = np.multiply(bpy_image.pixels, 255) array = np.array(pixels, dtype=np.uint8) array = np.reshape(array, (bpy_image.size[1], bpy_image.size[0], 4)) print(np.shape(array)) img = Image.fromarray(array) imgplot = plt.imshow(img) plt.show()

Although you can't get 0.001 steps, the steps should be 1/255 = 0.0039... Try 1/255*5=0.0196..., or just use 5.0/255.0 to get 5 in the red channel.

This provides a simple test. Replace pixels in bpy image with X/255.0, then you can just hover over the images and see the RGB values, which are all int8 and not float.

show_image(bpy_image):
    pixels = np.multiply(bpy_image.pixels, 255)
    array = np.array(pixels, dtype=np.uint8)
    array = np.reshape(array, (bpy_image.size[1], bpy_image.size[0], 4))
    print(np.shape(array))
    img = Image.fromarray(array)
   imgplot = plt.imshow(img)
    plt.show()
added 481 characters in body
Source Link

Although you can't get 0.001 steps, the steps should be 1/255 = 0.0039... Try 1/255*5=0.0196..., or just use 5.0/255.0 to get 5 in the red channel.

This provides a simple test. Replace pixels in bpy image with X/255.0, then you can just hover over the images and see the RGB values, which are all int8 and not float.

def show_image(bpy_image): pixels = np.multiply(bpy_image.pixels, 255) array = np.array(pixels, dtype=np.uint8) array = np.reshape(array, (bpy_image.size[1], bpy_image.size[0], 4)) print(np.shape(array)) img = Image.fromarray(array) imgplot = plt.imshow(img) plt.show()

Although you can't get 0.001 steps, the steps should be 1/255 = 0.0039... Try 1/255*5=0.0196..., or just use 5.0/255.0 to get 5 in the red channel.

Although you can't get 0.001 steps, the steps should be 1/255 = 0.0039... Try 1/255*5=0.0196..., or just use 5.0/255.0 to get 5 in the red channel.

This provides a simple test. Replace pixels in bpy image with X/255.0, then you can just hover over the images and see the RGB values, which are all int8 and not float.

def show_image(bpy_image): pixels = np.multiply(bpy_image.pixels, 255) array = np.array(pixels, dtype=np.uint8) array = np.reshape(array, (bpy_image.size[1], bpy_image.size[0], 4)) print(np.shape(array)) img = Image.fromarray(array) imgplot = plt.imshow(img) plt.show()

added 3 characters in body
Source Link
Loading
added 4 characters in body
Source Link
Loading
added 1 character in body
Source Link
Loading
Source Link
Loading