# makeimage.py
# Make a Gray scale image

import cv2
import numpy as np

# Image dimension
width = 255
height= 255

# Create a 2D array
image = np.full((height, width), 0.0)

# Print Array Dimensions
print(image.shape)

# Create a Gradient Image
for rowindex in range(image.shape[0]):
    colorvalue = 0
    for colindex in range(image.shape[1]):
        image[rowindex][colindex] = colorvalue / 255.0
        colorvalue += 1

# Print the Image matrix
print(image)

# Show the image
cv2.imshow("Image", image)

# Wait for a key press
cv2.waitKey(0)

# Close all keys
cv2.destroyAllWindows()
a4eab776e6d71a46c35e5e1f846c5dcd3871415e
<mask token>

<mask token>
print(image.shape)
for rowindex in range(image.shape[0]):
    colorvalue = 0
    for colindex in range(image.shape[1]):
        image[rowindex][colindex] = colorvalue / 255.0
        colorvalue += 1
print(image)
cv2.imshow('Image', image)
cv2.waitKey(0)
cv2.destroyAllWindows()

<mask token>
width = 255
height = 255
image = np.full((height, width), 0.0)
print(image.shape)
for rowindex in range(image.shape[0]):
    colorvalue = 0
    for colindex in range(image.shape[1]):
        image[rowindex][colindex] = colorvalue / 255.0
        colorvalue += 1
print(image)
cv2.imshow('Image', image)
cv2.waitKey(0)
cv2.destroyAllWindows()

import cv2
import numpy as np
width = 255
height = 255
image = np.full((height, width), 0.0)
print(image.shape)
for rowindex in range(image.shape[0]):
    colorvalue = 0
    for colindex in range(image.shape[1]):
        image[rowindex][colindex] = colorvalue / 255.0
        colorvalue += 1
print(image)
cv2.imshow('Image', image)
cv2.waitKey(0)
cv2.destroyAllWindows()

# makeimage.py
# Make a Gray scale image

import cv2
import numpy as np

# Image dimension
width = 255
height= 255

# Create a 2D array
image = np.full((height, width), 0.0)

# Print Array Dimensions
print(image.shape)

# Create a Gradient Image
for rowindex in range(image.shape[0]):
    colorvalue = 0
    for colindex in range(image.shape[1]):
        image[rowindex][colindex] = colorvalue / 255.0
        colorvalue += 1

# Print the Image matrix
print(image)

# Show the image
cv2.imshow("Image", image)

# Wait for a key press
cv2.waitKey(0)

# Close all keys
cv2.destroyAllWindows()