🎬Python: Resizing and Converting Images to Base64 format using Python in Google Colab.
Welcome to our Python tutorial! In today`s session, we`ll delve into the process of uploading images to Google Colab using Python. We`ll then proceed to resize these images and convert them into base 64 format for integration into Power BI visuals.
To get started, open a new notebook in Google Colab and rename/save it. In this tutorial, we`ll be working with a set of images that we plan to utilize in our next Power BI tutorial, presented in base 64 format.
Here`s a breakdown of the steps covered in this tutorial:
Upload Images to Google Colab:
Import the files library to facilitate file uploads.
Use the files.upload command to upload the images.
Execute the code, select the desired files, and wait for the upload to complete.
Resize Images:
Utilize the Pillow imaging library for image manipulation.
Iterate through the uploaded files, displaying their names.
Open and display each image, then resize them to 128x72 dimensions.
Convert to Base 64:
Employ the io and base64 libraries for working with binary data.
Save the resized image in PNG format to an in-memory object.
Encode the binary data into base 64 format using base64.b64encode.
Prepare Data for Power BI:
Print and copy the base 64 data.
Create an Excel file with columns for car names and base 64 data.
Apply appropriate formatting for the base 64 data to align with each car name.
Integrate with Power BI:
Open Power BI Desktop and load the Excel file.
In the Power Query Editor, ensure proper column headers and data alignment.
Visualize the data in Power BI using a matrix visual.
Congratulations! You`ve successfully created base 64 images using Python and incorporated them into Power BI visuals. Stay tuned for our next tutorial, where we`ll build a Power BI dashboard based on these images.
If you found this tutorial helpful, please like, subscribe, and hit the bell icon for more insightful tutorials and updates. Thanks for watching!
#PythonTutorial #GoogleColab #ImageUpload #Base64Conversion #PowerBI #DataVisualization #PillowLibrary #BinaryData #DataIntegration #Excel #PowerBIDashboard #Tutorial #Coding #Programming #DataScience #TechTutorial #PythonProgramming #ImageProcessing #DataAnalysis #SubscribeNow #LikeAndShare #BellNotification #TechUpdates