mirror of
https://github.com/aljazceru/Image-Quote-Generator.git
synced 2025-12-19 15:04:24 +01:00
w8lifts customer
This commit is contained in:
14
main.py
14
main.py
@@ -5,7 +5,7 @@ import helper
|
||||
# Available topics: christian, fitness
|
||||
TOPIC = "fitness"
|
||||
SHOW_AUTHOR = True
|
||||
CUSTOMER_NAME = "final_no_logo"
|
||||
CUSTOMER_NAME = "w8lifts_100logo"
|
||||
NUM_OF_POSTS = -1 # If number of posts if set to -1, it will so as many posts as in the data file
|
||||
|
||||
# Define the paths and values to everything
|
||||
@@ -30,12 +30,12 @@ if __name__ == "__main__":
|
||||
# helper.darken_images(images_folder_cropped, images_folder_cropped_darken)
|
||||
|
||||
# LOGO
|
||||
# post_handler.create_posts(images_folder=images_folder_cropped_darken, text_file=text_file,
|
||||
# quote_font=quote_font, author_font=author_font, output_folder=output_folder,
|
||||
# logo_file=logo_file, customer_name=CUSTOMER_NAME, number_of_posts=NUM_OF_POSTS, show_author=SHOW_AUTHOR)
|
||||
|
||||
# NO LOGO
|
||||
post_handler.create_posts(images_folder=images_folder_cropped_darken, text_file=text_file,
|
||||
quote_font=quote_font, author_font=author_font, output_folder=output_folder,
|
||||
customer_name=CUSTOMER_NAME, number_of_posts=NUM_OF_POSTS, show_author=SHOW_AUTHOR)
|
||||
logo_file=logo_file, customer_name=CUSTOMER_NAME, number_of_posts=NUM_OF_POSTS, show_author=SHOW_AUTHOR)
|
||||
|
||||
# NO LOGO
|
||||
# post_handler.create_posts(images_folder=images_folder_cropped_darken, text_file=text_file,
|
||||
# quote_font=quote_font, author_font=author_font, output_folder=output_folder,
|
||||
# customer_name=CUSTOMER_NAME, number_of_posts=NUM_OF_POSTS, show_author=SHOW_AUTHOR)
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ def create_posts(images_folder, text_file, quote_font, author_font, output_folde
|
||||
start_time = time.time()
|
||||
print(f"Creating Post #{i}")
|
||||
|
||||
author_text = ""
|
||||
quote_text = ""
|
||||
text = quotes[i]
|
||||
quote = text.split(":::")
|
||||
quote_text = quote[0]
|
||||
@@ -81,8 +83,6 @@ def create_posts(images_folder, text_file, quote_font, author_font, output_folde
|
||||
run_time = end_time - start_time
|
||||
run_time_average += run_time
|
||||
print(f"\033[0;34m DONE #{i}, Run time:", round(run_time, 2), "seconds! \033[0m", output_path)
|
||||
author_text = ""
|
||||
quote_text = ""
|
||||
|
||||
if number_of_posts > 1:
|
||||
run_time_average /= number_of_posts
|
||||
@@ -147,8 +147,8 @@ def create_post(image_file, quote_text, quote_font, author_font, output_path, fi
|
||||
# Open logo file
|
||||
img_logo = Image.open(logo_file)
|
||||
|
||||
# Reduce the alpha of the overlay image by 40%
|
||||
alpha = 0.6
|
||||
# Reduce the alpha of the overlay image by 30%
|
||||
alpha = 0.7
|
||||
enhancer = ImageEnhance.Brightness(img_logo)
|
||||
img_logo_darken = enhancer.enhance(alpha)
|
||||
|
||||
|
||||
BIN
sources/logo.png
BIN
sources/logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
BIN
sources/logo.psd
BIN
sources/logo.psd
Binary file not shown.
Reference in New Issue
Block a user