# 이미지 다운로드(requests)
with open(C:\Users\joo\PycharmProjects\agriis\file.jpg', 'wb') as f:
f.write(requests.get(img, verify=False).content)
# 이미지를 클립보드 저장
from io import BytesIO
import win32clipboard
from PIL import Image
def send_to_clipboard(clip_type, data):
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(clip_type, data)
win32clipboard.CloseClipboard()
filefath = 1.jpg
image = Image.open(filefath)
output = BytesIO()
image.convert("RGB").save(output, "BMP")
data = output.getvalue()[14:]
output.close()
send_to_clipboard(win32clipboard.CF_DIB, data)
# 폴더에 저장된 이미지 삭제
os.remove(1.jpg)