Skip to content

Conversation

stribus
Copy link

@stribus stribus commented Dec 26, 2024

add ability to convert png and other image files into a string that can be copy/pasted directly in the source code, so that they don’t have to be shared separately with people’s pyautogui scripts. (ImageToBase64 e Base64ToImage)

usage:

import pyautogui
im = pyautogui.screenshot(region=(0,0, 300, 400))
b64img = ImageToBase64(im)
print(b64img)
...

im2 = Base64ToImage(b64img)
region = pyautogui.locateOnScreen(im2)

…an be copy/pasted directly in the source code, so that they don’t have to be shared separately with people’s pyautogui scripts. (ImageToBase64 e Base64ToImage)

usage:
```python

import pyautogui
im = pyautogui.screenshot(region=(0,0, 300, 400))
b64img = ImageToBase64(im)
print(b64img)
...

im2 = Base64ToImage(b64img)
region = pyautogui.locateOnScreen(im2)
```
@stribus stribus closed this Sep 21, 2025
@stribus stribus reopened this Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant