diff --git a/Numbers.xlsx b/Numbers.xlsx index 8a87cf1..0b7be24 100644 Binary files a/Numbers.xlsx and b/Numbers.xlsx differ diff --git a/graphs.py b/graphs.py index 6a8f3db..86ee09d 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("Roth IRA",wb["O Mountain"]["A2"].value,wb["O Mountain"]["C2"].value) + fig = make_basic_greenred_NL("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("Roth Catch Up",wb["O Mountain"]["A4"].value,wb["O Mountain"]["C4"].value) + fig = make_basic_greenred_NL("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("401K Contribution",wb["O Mountain"]["A6"].value,wb["O Mountain"]["C6"].value) + fig = make_basic_greenred_NL("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("401K Catch Up",wb["O Mountain"]["A8"].value,wb["O Mountain"]["C8"].value) + fig = make_basic_greenred_NL("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 3339493..33c689a 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,33 +25,9 @@ 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),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) - + draw.text((442, 623),"12K",(0,0,0),font=font) graph_comp.save("./gen/I_mountain.png") - - - @@ -64,21 +40,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_Catch_Up.png') + K401 = Image.open('./.gen/401K_Contribution.png') K401 = cords.scale(K401,0.378) - blank.paste(K401, cords.center_on(K401,(549,806)),K401) + blank.paste(K401, cords.center_on(K401,(386,806)),K401) - K401C = Image.open('./.gen/401K_Contribution.png') + K401C = Image.open('./.gen/401K_Catch_Up.png') K401C = cords.scale(K401C,0.378) - blank2.paste(K401C, cords.center_on(K401C,(384,806)),K401C) + blank2.paste(K401C, cords.center_on(K401C,(557,806)),K401C) IRAC = Image.open('./.gen/Roth_Catch_Up.png') IRAC = cords.scale(IRAC,0.265) - blank.paste(IRAC, cords.center_on(IRAC,(1172,855)),IRAC) + blank.paste(IRAC, cords.center_on(IRAC,(1177,855)),IRAC) IRA = Image.open('./.gen/Roth_IRA.png') IRA = cords.scale(IRA,0.265) - blank2.paste(IRA, cords.center_on(IRA,(1421,855)),IRA) + blank2.paste(IRA, cords.center_on(IRA,(1425,855)),IRA) if wb["O Mountain"]["B16"].value: @@ -90,26 +66,13 @@ 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) - - 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") - + #Mask and combine + Image.composite(blank, O_Mountain, O_Mountain_Mask).save("./gen/O_mountian.png") def gen_Oh_I_Mountain(wb): @@ -124,9 +87,3 @@ 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 4ddb7d3..42273f3 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 16f00bb..3510661 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 deleted file mode 100644 index 3510661..0000000 Binary files a/templets/O_mountain_old.png and /dev/null differ diff --git a/templets/icons/checkmark-circle-svgrepo-com.png b/templets/icons/checkmark-circle-svgrepo-com.png deleted file mode 100644 index 95d0792..0000000 Binary files a/templets/icons/checkmark-circle-svgrepo-com.png and /dev/null differ diff --git a/templets/icons/checkmark-svgrepo-com.png b/templets/icons/checkmark-svgrepo-com.png deleted file mode 100644 index 059b9d5..0000000 Binary files a/templets/icons/checkmark-svgrepo-com.png and /dev/null differ diff --git a/templets/icons/close-svgrepo-com.png b/templets/icons/close-svgrepo-com.png deleted file mode 100644 index b620dad..0000000 Binary files a/templets/icons/close-svgrepo-com.png and /dev/null differ