This should do it in Python:
import base64
encoded = base64.b64encode(open("filename.png", "rb").read())
More Related Contents:
- How to parse data-uri in python?
- Convert RGB color to English color name, like ‘green’ with Python
- Saving a Numpy array as an image
- Convert string in base64 to image and save on filesystem
- Python: Ignore ‘Incorrect padding’ error when base64 decoding
- Is there any other way to load a resource like an image, sound, or font into Pygame? [closed]
- How to merge a transparent png image with another image using PIL
- Extract images from PDF without resampling, in python?
- Is embedding background image data into CSS as Base64 good or bad practice?
- Get pixel’s RGB using PIL
- Extract a page from a pdf as a jpeg
- How to get the cells of a sudoku grid with OpenCV?
- Application not picking up .css file (flask/python) [duplicate]
- Interactive pixel information of an image in Python?
- Image comparison algorithm
- Detect and visualize differences between two images with OpenCV Python
- How do I get the picture size with PIL?
- Can you “stream” images to ffmpeg to construct a video, instead of saving them to disk?
- How to Split Image Into Multiple Pieces in Python
- How to obtain image size using standard Python class (without using external library)?
- Is it possible to create encoded base64 URL from Image object?
- How to rotate an image around its center while its scale is getting larger(in Pygame)
- How to make a movie out of images in python
- How to use CSS selectors to retrieve specific links lying in some class using BeautifulSoup?
- Read a base 64 encoded image from memory using OpenCv python library
- Python – Find dominant/most common color in an image
- How to show PIL images on the screen?
- How can I obtain the image size using a standard Python class (without using an external library)?
- How to embed image or picture in jupyter notebook, either from a local machine or from a web resource?
- Savefig outputs blank image