I'm trying to convert my image from rgba to rgb using PIL then detect the most used colors using Color-Thief-Py. However when I try to pass the rgb converted image into to the colorthief function, I get the following error: AttributeError: read
.
Here's the code:
logo = request.FILES.get('logo')
rgba_img = Image.open(logo)
rgb_img = rgba_img.convert('RGB')
color = io.BytesIO(rgb_img.read()) #AttributeError: read
color_thief = ColorThief(color)
What am I doing wrong & How can I resolve it?