Discord.Py blend pictures and send them without dowload them

  bytesio, cv2, discord, python, python-imaging-library

I have the following problem:

1.- I want to send a file in discord without dowloading. I don’t know if this is posible but I want to send it for example with BytesIo.

2.- I have one picture saved on my Bot files and the other one comes from ctx.author.avatar

3.- I want to blend both images and send the result. With blend I mean like for example if I would be using cv2 I would use addWeighted().

The Code I have right know what does is dowload the picture of the member, using cv2 to read both pictures, resize them and use addWeighted. After that I save the blend picture and I send it as a message. When all It’s done I delete the pictures (both, the avatar and the blend one). From my point of view this is really inefficient, thats why I want know if there is a way using PIL and BytesIo or something to use the dataArray to blend them and send it without dowload it.

So in short, I want to know if there is a way to blends both images without download the second one (member avatar picture) and send it without dowloading the blend image.

I can the code I already have if needed but as my code is download the picture I guess that won’t help.

Source: Python Questions

LEAVE A COMMENT