So, I'm trying to create a image fill it up with colors and then display it for debugging. I've created the image with pillow, set it to black or, (0,0,0) in rgb, I cycle through and fill up the image with actual color, etc. But then I get an error for some attribute I don't know how to fill up in python.
import cv2
import tkinter as tk
import copy
from PIL import Image
from tkinter import filedialog
colorwheel = Image.new('RGB', (1, 255*7), color='black')
colorwheel = colorwheel.load()
colorwheel[0,1]=(255,255,0)
colorwheel[0,2] = (255, 255, 0)
r=255
g=255
b=0
#keep value of green, add take away red
for i in range( 255):
colorwheel[0, i] = (255-1, 255, 0)
#go to blue take away green
for i in range( 255):
colorwheel[0,255*2 + i] = (0, 255-i,0+1)
#go to purple 128 keep blue, add red to 128
for i in range (255):
colorwheel[0, 255*3 + i] = (int(i/2), 0, 255)
#go to red
for i in range( 255):
colorwheel[0,255*4 + i]=(int(i/2),0,255-i)
#go to orange
for i in range(255):
colorwheel[0, 255 * 5 + i] = (128, int(i / 2), 0) #keep red 128
for i in range(255):
colorwheel[0, 255 * 6 + i] =(128,int(128+i/2),0)
colorwheel.resize((50,255*7))
cv2.imshow('image', colorwheel)
It should have everything it needs to resize and display the image, but I get this.
File "C:/Users/misterE/PycharmProjects/frame2cc/base contraster", line 64, in <module>
colorwheel.resize((50,255*7))
AttributeError: 'PixelAccess' object has no attribute 'resize'