SamuraiPolix / Image-Quote-Generator

Create high-quality images with quotes (Perfect for Instagram and Pinterest) in less than 5 seconds per 100+ images!
GNU General Public License v3.0
15 stars 5 forks source link
christian christian-quotes fitness fitness-quotes graphics image-generation image-generator image-processing python quote-generator quote-image quote-maker quote-to-image quotes quotes-generator quotes-on-design text text-art text-to-image text-to-quote

Python PayPal

Image Quotes Generator

This script creates high-quality image quotes, perfect for Instagram/Pinterest **in less than 5 seconds per 100+ images!**

📷 Examples

📝 Table of Contents

  1. About
  2. How it works
  3. How To Run
  4. Available Topics
  5. Built Using
  6. Final Results
  7. Note

🧐 About

This is one of my first Python projects, hope you get the most out of it :)

I used it to sell Fitness and Christian quotes on Fiverr for a while.

💭 How it works

#1 Content

After choosing the topics I wanted, I got a list of quotes and a stock of 50+ background images - both related to the picked topic.

#2 Prepping

After getting enough images, I run those 2 functions:

helper.cut_images_new(): to crop the images to the desired dimensions.

helper.darken_images(): to darken the images so the text looks better.

#3 Editing

The script works by taking a background image from '/sources/images/{topic}' and a quote from the .txt file, and combining them into 1 photo.

I am using PILLOW to generate the text in different fonts and combine it with the background image.

All the images are copyright-free from stock footage websites, and the fonts are copyright-free as well.

🏁 How to run

Follow the instructions given below to get this script up and running on your device.

  1. Download this repository as zip file / using git.
  2. Open the folder.
  3. Make sure all the required modules are installed. (pip install -r requirements.txt)
  4. Open main.py
  5. set the number of posts you want, your logo, and choose a topic (It can be one of the available topics, or you can add another one, how to is explained here)
    TOPIC = "fitness"
    SHOW_AUTHOR = True
    CUSTOMER_NAME = "your_name"
    NUM_OF_POSTS = 35
  6. RUN!
  7. And that's it! In about 5 seconds, you will have 100+ generated images!
  8. You can find your images in the generated/your_name/ directory.

📋 Available Topics

  1. Christian
  2. Fitness

To create a new topic, please follow these steps:

  1. Create a {topic}.txt file inside /sources/text_data
  2. Run "helper.create_new_topic_dirs(TOPIC, project_dir)" to auto create all the directories needed
  3. Add images to /sources/images/{topic}
  4. Run "helper.cut_images_new(images_folder, images_folder_cropped)" to crop the images to 1080 X 1350 (you can change the dimension inside the function)
  5. Run "helper.darken_images(images_folder_cropped, images_folder_cropped_darken)" if you want to make the images darker (it makes the text look better)

ANS THAT'S IT! :) Feel free to create a Pull Request if you want to help others as well!

⛏️ Built Using

PILLOW - For generating text images

📷 Final Results

After running the script you will get:

  1. The edited images.
  1. A spreadsheet containing the file names, quotes, and authors, to make it easier to find the image you want.

🗒️ Note

Note that this script is very basic as of now. If you want to contribute, you are free to do so and you may even fork and improve this repository.