diff --git a/Numbers.xlsx b/Numbers.xlsx index 0b7be24..8a87cf1 100644 Binary files a/Numbers.xlsx and b/Numbers.xlsx differ diff --git a/graphs.py b/graphs.py index 86ee09d..6a8f3db 100644 --- a/graphs.py +++ b/graphs.py @@ -71,25 +71,25 @@ def gen_DI(wb): # Generates graph for Roth IRA def gen_Roth_IRA(wb): - fig = make_basic_greenred_NL("Roth IRA",wb["O Mountain"]["A2"].value,wb["O Mountain"]["C2"].value) + fig = make_basic_greenred("Roth IRA",wb["O Mountain"]["A2"].value,wb["O Mountain"]["C2"].value) fig.savefig('./.gen/Roth_IRA.png',dpi=300) # Generates graph for Roth Catch Up def gen_Roth_Catch_Up(wb): - fig = make_basic_greenred_NL("Roth Catch Up",wb["O Mountain"]["A4"].value,wb["O Mountain"]["C4"].value) + fig = make_basic_greenred("Roth Catch Up",wb["O Mountain"]["A4"].value,wb["O Mountain"]["C4"].value) fig.savefig('./.gen/Roth_Catch_Up.png',dpi=300) # Generates graph for 401K contribution def gen_401K_Contribution(wb): - fig = make_basic_greenred_NL("401K Contribution",wb["O Mountain"]["A6"].value,wb["O Mountain"]["C6"].value) + fig = make_basic_greenred("401K Contribution",wb["O Mountain"]["A6"].value,wb["O Mountain"]["C6"].value) fig.savefig('./.gen/401K_Contribution.png',dpi=300) # Generates graph for 401K contribution Catch Up def gen_401K_Catch_Up(wb): - fig = make_basic_greenred_NL("401K Catch Up",wb["O Mountain"]["A8"].value,wb["O Mountain"]["C8"].value) + fig = make_basic_greenred("401K Catch Up",wb["O Mountain"]["A8"].value,wb["O Mountain"]["C8"].value) fig.savefig('./.gen/401K_Catch_Up.png',dpi=300) diff --git a/imageGen.py b/imageGen.py index 33c689a..3339493 100644 --- a/imageGen.py +++ b/imageGen.py @@ -1,7 +1,7 @@ from openpyxl import Workbook import cords from PIL import Image, ImageDraw, ImageFont - +import numpy as np def gen_I_Mountain(wb): ## I Mountain image code @@ -25,9 +25,33 @@ def gen_I_Mountain(wb): graph_comp = Image.composite(blank, I_Mountain, I_Mountain_Mask) #.save("./gen/I_mountain.png") draw = ImageDraw.Draw(graph_comp) font = ImageFont.truetype("./fonts/Asap_Condensed/AsapCondensed-Bold.ttf", 36) - draw.text((442, 623),"12K",(0,0,0),font=font) + draw.text((442, 623),format_frendly(wb["I Mountain"]["A2"].value),(0,0,0),font=font) + + #Add box values + + if wb["I Mountain"]["B16"].value: + icon = Image.open('./templets/icons/checkmark-svgrepo-com.png') + icon = cords.scale(icon,0.035) + graph_comp.paste(icon, cords.center_on(icon, (1125,365)),icon) + else: + icon = Image.open('./templets/icons/checkmark-svgrepo-com.png') + icon = cords.scale(icon,0.035) + graph_comp.paste(icon, cords.center_on(icon, (1237,365)),icon) + + if wb["I Mountain"]["B17"].value: + icon = Image.open('./templets/icons/checkmark-svgrepo-com.png') + icon = cords.scale(icon,0.035) + graph_comp.paste(icon, cords.center_on(icon, (910,910)),icon) + else: + icon = Image.open('./templets/icons/checkmark-svgrepo-com.png') + icon = cords.scale(icon,0.035) + graph_comp.paste(icon, cords.center_on(icon, (1035,910)),icon) + graph_comp.save("./gen/I_mountain.png") + + + @@ -40,21 +64,21 @@ def gen_O_Mountain(wb): blank = Image.open('./templets/O_mountain.png').convert('RGBA').resize((1920, 1080)) blank2 = Image.new('RGBA',(1920,1080)) - K401 = Image.open('./.gen/401K_Contribution.png') + K401 = Image.open('./.gen/401K_Catch_Up.png') K401 = cords.scale(K401,0.378) - blank.paste(K401, cords.center_on(K401,(386,806)),K401) + blank.paste(K401, cords.center_on(K401,(549,806)),K401) - K401C = Image.open('./.gen/401K_Catch_Up.png') + K401C = Image.open('./.gen/401K_Contribution.png') K401C = cords.scale(K401C,0.378) - blank2.paste(K401C, cords.center_on(K401C,(557,806)),K401C) + blank2.paste(K401C, cords.center_on(K401C,(384,806)),K401C) IRAC = Image.open('./.gen/Roth_Catch_Up.png') IRAC = cords.scale(IRAC,0.265) - blank.paste(IRAC, cords.center_on(IRAC,(1177,855)),IRAC) + blank.paste(IRAC, cords.center_on(IRAC,(1172,855)),IRAC) IRA = Image.open('./.gen/Roth_IRA.png') IRA = cords.scale(IRA,0.265) - blank2.paste(IRA, cords.center_on(IRA,(1425,855)),IRA) + blank2.paste(IRA, cords.center_on(IRA,(1421,855)),IRA) if wb["O Mountain"]["B16"].value: @@ -66,13 +90,26 @@ def gen_O_Mountain(wb): FSA = cords.scale(FSA,0.265) blank2.paste(FSA, cords.center_on(FSA,(764,445)),FSA) + + #Mask and combine blank2 = Image.composite(blank2, Image.new('RGBA',(1920,1080)), O_Mountain_Mask2) blank = Image.alpha_composite(blank,blank2) - #Mask and combine - Image.composite(blank, O_Mountain, O_Mountain_Mask).save("./gen/O_mountian.png") + + graph_comp = Image.composite(blank, O_Mountain, O_Mountain_Mask) + draw = ImageDraw.Draw(graph_comp) + font = ImageFont.truetype("./fonts/Asap_Condensed/AsapCondensed-Bold.ttf", 36) + + draw.text((440, 595),format_frendly(wb["O Mountain"]["B6"].value),(0,0,0),font=font) + draw.text((605, 595),format_frendly(wb["O Mountain"]["B8"].value),(0,0,0),font=font) + + draw.text((1485, 703),format_frendly(wb["O Mountain"]["B2"].value),(0,0,0),font=font) + draw.text((1240, 703),format_frendly(wb["O Mountain"]["B4"].value),(0,0,0),font=font) + + graph_comp.save("./gen/O_mountian.png") + def gen_Oh_I_Mountain(wb): @@ -87,3 +124,9 @@ def gen_Oh_I_Mountain(wb): #Mask and combine Image.composite(blank, Oh_I_Mountain, Oh_I_Mountain_Mask).save("./gen/Oh_I_mountain.png") + + + +def format_frendly(num): + T = num / 1000 + return str(int(np.floor(T)))+"K" diff --git a/templets/I_mountain.png b/templets/I_mountain.png index 42273f3..4ddb7d3 100644 Binary files a/templets/I_mountain.png and b/templets/I_mountain.png differ diff --git a/templets/O_mountain.png b/templets/O_mountain.png index 3510661..16f00bb 100644 Binary files a/templets/O_mountain.png and b/templets/O_mountain.png differ diff --git a/templets/O_mountain_old.png b/templets/O_mountain_old.png new file mode 100644 index 0000000..3510661 Binary files /dev/null and b/templets/O_mountain_old.png differ diff --git a/templets/icons/checkmark-circle-svgrepo-com.png b/templets/icons/checkmark-circle-svgrepo-com.png new file mode 100644 index 0000000..95d0792 Binary files /dev/null and b/templets/icons/checkmark-circle-svgrepo-com.png differ diff --git a/templets/icons/checkmark-svgrepo-com.png b/templets/icons/checkmark-svgrepo-com.png new file mode 100644 index 0000000..059b9d5 Binary files /dev/null and b/templets/icons/checkmark-svgrepo-com.png differ diff --git a/templets/icons/close-svgrepo-com.png b/templets/icons/close-svgrepo-com.png new file mode 100644 index 0000000..b620dad Binary files /dev/null and b/templets/icons/close-svgrepo-com.png differ