Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to convert png and other image files into a string that c… #903

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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)
```
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