Programmatically create Images, Memes, Watermarks using Python with imgmaker
Skills:
AI Productivity Tools90%
Key Takeaways
Programmatically creates images, memes, and watermarks using Python with imgmaker
Full Transcript
hey friends welcome to one little coder in this video we are going to look at a new Python package that's called image maker IMG Mak it's by minimax sir so whose name is max wolf it's a nice package for you to create or some image with text on it so usually if you see memes are made this way so let's go ahead and get started with this package I'm not going to explain you what you can use this package for I'll leave it up to your creativity because you can create a lot of things we'll just look at what those things you can do it but first we'll go ahead and then install this package if you want to understand how this package works you can just see the little bit of description here so it basically uses Google Chrome via selenium to generate this image with the text on it and for the text they're using Python templating with gj2 and yeah so that's it's a very basic introduction so the description is so it helps you create high quality images programmatically with hackable templates so let's say you're going to run a Twitter bot or reddit board or something like that and where you have to constantly generate new images so you can probably use this otherwise if you do not want to get into this fun part let's say you're a photographer and you want to constantly watermark your images with a single template once again python is there for your rescue and you can use this package to watermark your images especially if you want to share it on social media you can do it with this package so let's go ahead and install this package I'm going to do everything within my vs code for simplicity so if you do not have python extension 4 vs code just go to your extension setup and then install your Python so that that's quite handy Xcode is really handy so go to your terminal new terminal and PI pip install I am G Mak yeah so this will install this package and as you have seen here so you also need the comb driver and please make sure that you have got google chrome installed so when I first write this package I didn't up Chrome on my machine so it was throwing a chrome binary machine error so that is one thing and then the other thing that I faced is when I first installed this package I am l package was missing so if you do not have that thing please install PI ml package if in case if you get that error you have to install PI ml package so that's just a heads up but I hope you don't have those problems I've specifically created a folder for this project and that is image market demo and the reason I've created a folder is because when you download the chrome driver for your selenium background thing this is where the driver going it will get downloaded so image maker so it's better to keep it in one folder or if you want to create a virtual environment so that's that's up to you chrome driver so based on your operating system it's going to download the chrome driver okay so it says it has downloaded the chrome driver let's go and check okay so you can see that chrome driver is installed and I've also created a Python file so let's now go to his documentation and then first try to do exactly like what he has suggested us to do so from image maker let some input image maker image maker ie we are initializing it and let's generate an image and um this this is what we would ultimately get so let's try to run it mmm let's see if it's executing okay so it's trying to listen the chrome side of its executed let's go ahead okay I think the problem is because the output image is so saved here just go to the folder where I have this image maker okay now let me run that so that this image gets generated here so ultimately we can give the path the generate function if you see the tutorial you would see that you can give the path let me just you can give the path and generate as far as I guess but it's it's simpler for us to go here and run it and you can open the emergency oh that's it so you have got the image the title and then the subtitle so let's hack it a bit let's say okay let's see what are all the parameters that we can give so you you can give title you can give subtitle and you can define the color and if you want a different custom CSS you can do that so let's just copy this and say okay to do this oops copy paste and I'll say image maker demo simply say from one little cord okay okay so from one little coder color because we can say is doc is fine and I don't want any custom CSS that's it's completely okay let's run it so it's getting installed you can actually see that it is successfully ran okay so image maker demo from one little coder so the message successfully created so that's the first basic use case of this but I think a lot of us might be interested in doing other things like creating me more watermarking so let's go to the tutorial and just have a brief look at it so first mean so mean if you see the parameters it takes four parameters one background you have to define the background image second you have to give the top text then bottom text so which would generate something like this so let's leave Melissa and if I want to pick some popular mean I don't know popular mean let's see first popular notice popular me okay most famous internet memes all the time I think let's take this kid meme kid there is a kid okay oops okay let me not take any kid I don't know to get into me okay issue so I'll just take this image which has been there on internet afraid now and then we mesh okay so I've got this image from Pocket lint probably so I will go here I say I want to give sorry I will just remove this will give these parameters so first we have to initialize it with mean and then say within meme you have to say or background okay let's hope it works without that and top text is our precious Python the same bottom textures learn sequel first okay let's see if it works out let's see your luck mmm it's saying image maker oh sorry I'm extremely sorry it should be inside generate i dot generate and i is equal to image maker instance it's generating it's listening to the dev tools and let's hope if we have an image let's see oh great so our versus Python alone sequel first that's nice so we have successfully managed to generate a meme from this tool so that is good and the third use case that we just talked about is watermarking the image which is to say that you have an image you have a background it's a something that you created and you want to add a text branded takes something like this so you can do that so the way we have to do is we have to generate it with watermark and then we have to say what is your left takes what is your ID text and as you can see this text it takes mugged on so it's let's do this thing for a different one okay so let's take image generate and let's say I have I have an at unsplash let's say ah and splash will take some picture from one splash and then we'll try to generate an image that will give credit to the unsplash okay let's take this image copy image location okay so we'll say a background background is this okay okay it's not necessarily giving the image okay if you want it to be downloaded that's respect element we need the image right let's give it I let's give it a try with the URL that we got so we'll get to know whether it takes let me just copy paste it okay it gives okay and the username Neal left text let's say bye what does a picture's name do we have any name of this picture golden drain okay gold in the rain let me check huh I don't want on any icon and branded text needles okay just remove this for now so this the format is very simple you load image maker library you initialize an instance and then from that you generate its generator something is wrong what is wrong okay that's my mistake once again I didn't mr. kuhmo I don't want to learn to rush off now cool so it's listening to the dev tools let's see what do we get it's done so let's go and see okay so goal in the rain by Neil Johnson Neil Johnson oh that's quite nice so you can actually see that this this library image maker by minimax sure it's really helping us in creating programmatically so that's the main point right so now this is part of your Python code so it doesn't matter whether you're building machine learning model or whether you are a web developer a full stack developer whatever it is this is just three lines of Python code that will help you programmatically generate really good quality images that can be used for anything that anything you want and you can also see that you can create your own template so whatever we use now as you can see watermark mean this is all in Bill template but you can create your 110 plate and then you can use their templates of example like we used mean so you can create something called demo dot HTML which is like your own template and then you can use that custom template to generate some image so you can see what the documentation is provided so this is using this demoted HTML and it's an old template so that's the point the point is so you have an HTML template and using that HTML template basically it renders in the browser and takes the screen shot after embedding the text and it gives you it's quite a handy package and if you are someone who loves to use Python for a fun you can definitely give this package a try and as a side note this author is also develop a young author or developer minimax ur is also accepting donations you can sponsor on github so you can go to patreon and sponsor the developer so this developer it can help this developer or probably motivate if you are not very comfortable or if you are not financially strong to do any of those things at least please star the github repo so that will be an appreciation for the developer so I hope this this video was quite helpful for you and let's see if you can make some memes or some kind of images with this so I would love to see it if you have any feedback let me know in the comment section and I would see you in the next video with some other tips thank you for watching ok bye bye
Original Description
This video demonstrates a new package called "imgmaker" by Github user @minimaxir. "imgmaker" can help you to generate Images with text, Memes, Watermarks or any images based on the Custom Template that you've designed. It's just 3 lines of code and you can use it for anything from Social Media Branding to Twitter Bots.
imgmaker github: https://github.com/minimaxir/imgmaker
Share your feedback or Follow me on Twitter: https://twitter.com/1littlecoder
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from 1littlecoder · 1littlecoder · 17 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
▶
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
How to create your Free Data Science Blog on Github with Fastpages from Fastai
1littlecoder
Making Interactive Matplotlib Plots for Data Science Visualizations on Jupyter (Python)
1littlecoder
Create your first Data Science Web App using R Shiny
1littlecoder
How to create a Reproducible Example in R using reprex
1littlecoder
No Code Visualization using esquisse with Tableau-like Drag and Drop GUI in R
1littlecoder
Scrape HTML Table using rvest and Process them for insights using tidyverse in R
1littlecoder
Google Teachable Machine Learning Build No Code AI solution
1littlecoder
Create meaningful fake tidy datasets in R using fakir [#rstats Package]
1littlecoder
How to enable using R Programming with Visual Studio VS Code
1littlecoder
Python, Community, Books - with Abhiram R - Bangpypers Co-organizers | 1littlecoder podcast
1littlecoder
Growing a Tech Community across India - Anubha Maneshwar, Founder Girlscript | 1littlecoder Podcast
1littlecoder
Intro to Google Colab - How to use Colab
1littlecoder
Intro to Plotly Express - Complex Interactive Charts with One-Line of Python Code
1littlecoder
Indic NLP Python Toolkit Open Source Development - iNLTK Creator Gaurav Arora | 1littlecoder Podcast
1littlecoder
Do you want a career in Data Science - Tamil Webinar
1littlecoder
Android Smartphone Analysis in R [Live Coding Screencast]
1littlecoder
Programmatically create Images, Memes, Watermarks using Python with imgmaker
1littlecoder
Kaggle Walkthrough to get you started with Data Science - Webinar
1littlecoder
Community, Corporate Job, Coding - Gnana Lakshmi T C aka Gyan, WomenWhoCode Leadership Fellow
1littlecoder
Easy ggplot2 Theme Customization with {ggeasy} | Data Visualization in R
1littlecoder
Excel to R - Pivot + Bar Chart in Excel & R using tidyverse [Live Coding]
1littlecoder
Excel to R #2 - VLOOKUP in Excel to LEFT_JOIN, MERGE in R
1littlecoder
5 websites to get Free Real-World Datasets for Data Science/ML Projects
1littlecoder
Excel to R #3 - APPROXIMATE VLOOKUP in Excel to FUZZY LEFT_JOIN in R
1littlecoder
Correlation-alternative PPS (Predictive Power Score) Python Package Demo
1littlecoder
Automated Website Screenshots in R using {webshot}
1littlecoder
Installing Custom RStudio Theme (Synthwave85)
1littlecoder
Analyse Google Trends Search Data in R using {gtrendsR}
1littlecoder
3 Tips to ask question on Stack Overflow the right way to get answers
1littlecoder
Learn Data Science with R - Mini Projects - Web Scraping Zomato
1littlecoder
Easily make Dumbbell Chart using {ggcharts} | Data Visualization in R
1littlecoder
GET Hackernews Front Page Results using REST API in R
1littlecoder
Quickly deploy ML WebApps from Google Colab using ngrok
1littlecoder
Use Jupyter Notebooks within VSCode (Visual Studio Code) in 2020
1littlecoder
Plotly Interactive Plots as Pandas Plotting Backend df.plot()
1littlecoder
Stack Overflow Developer Survey 2020 Highlights for New Programmers
1littlecoder
Matplotlib Animation Charts in Python using Celluloid
1littlecoder
Coding, Postwoman, Passion Project Book - Liyas Thomas Open Source Developer - 1littlecoder podcast
1littlecoder
Aspiring Data Scientist, Tips on How to learn Business Domain Knowledge
1littlecoder
Bokeh Interactive Charts as Pandas Plotting Backend df.plot_bokeh()
1littlecoder
Easy Fast Python Pandas Summary with Sidetable | Pandas Tips & Tricks
1littlecoder
Inception, Content Ideas, Consistency - Srivatsan Srinivasan AIEngineering YouTube Content Creator
1littlecoder
ggplot2 Text Customization with ggtext | Data Visualization in R
1littlecoder
Penguins Dataset Overview - iris alternative | EDA Data Visualization in R
1littlecoder
YouTube Growth Tips, Content Creation - Bhavesh Bhatt, YouTuber (Data Science & Machine Learning) #7
1littlecoder
Matplotlib Animated Bar Chart Race in Python | Data Visualization
1littlecoder
Simple Python GUI Development using {guietta}
1littlecoder
#8 Niche, Growth, Monetization - David Langer - YouTuber Dave on Data
1littlecoder
Simple Fast 3-step Python OCR using Deep Learning 40+ Languages
1littlecoder
Github New Feature Profile Summary/Mini-Resume - Profile Views
1littlecoder
Otto ML Assistant, GPT-3 on Philosophers, Nvidia-ARM - 3 ML Tech News
1littlecoder
What is OpenAI GPT-3 - Hype, Examples, Worries
1littlecoder
Julia 1.5, Datamuse API, Live HDR+ Pixel 4a - Machine Learning Tech News
1littlecoder
Self-driving Car Engineer sentenced, arXiv Dataset, AI/ML Startup Idea - Machine Learning Tech News
1littlecoder
GPT-3 Explorer, Ciphey (Automated Decryption), Py-Sudoku - ML Tech News
1littlecoder
How to use Advanced Google Search to extract Email Ids from Linkedin
1littlecoder
Cartoonizer Toon-IT (AI Web App), GPT-3 Advice, Android Earthquake Detection - ML Tech News
1littlecoder
Flow - R Package to visualize code logic, functions as a Flow Diagram
1littlecoder
Build GPT-3-like Language Model on Google Colab with minGPT [PyTorch]
1littlecoder
Create a Pencil Sketch Portrait with Python OpenCV
1littlecoder
More on: AI Productivity Tools
View skill →Related AI Lessons
🎓
Tutor Explanation
DeepCamp AI