Compare commits

...

3 commits

Author SHA1 Message Date
f70b063d2f Static File Updates 2024-07-13 06:04:08 +00:00
a99fd4a928 Dynamic Text 2024-07-13 06:03:41 +00:00
7059a572b3 Added labels to all graphs 2024-07-13 06:01:44 +00:00
9 changed files with 57 additions and 14 deletions

Binary file not shown.

View file

@ -71,25 +71,25 @@ def gen_DI(wb):
# Generates graph for Roth IRA # Generates graph for Roth IRA
def gen_Roth_IRA(wb): 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) fig.savefig('./.gen/Roth_IRA.png',dpi=300)
# Generates graph for Roth Catch Up # Generates graph for Roth Catch Up
def gen_Roth_Catch_Up(wb): 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) fig.savefig('./.gen/Roth_Catch_Up.png',dpi=300)
# Generates graph for 401K contribution # Generates graph for 401K contribution
def gen_401K_Contribution(wb): 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) fig.savefig('./.gen/401K_Contribution.png',dpi=300)
# Generates graph for 401K contribution Catch Up # Generates graph for 401K contribution Catch Up
def gen_401K_Catch_Up(wb): 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) fig.savefig('./.gen/401K_Catch_Up.png',dpi=300)

View file

@ -1,7 +1,7 @@
from openpyxl import Workbook from openpyxl import Workbook
import cords import cords
from PIL import Image, ImageDraw, ImageFont from PIL import Image, ImageDraw, ImageFont
import numpy as np
def gen_I_Mountain(wb): def gen_I_Mountain(wb):
## I Mountain image code ## 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") graph_comp = Image.composite(blank, I_Mountain, I_Mountain_Mask) #.save("./gen/I_mountain.png")
draw = ImageDraw.Draw(graph_comp) draw = ImageDraw.Draw(graph_comp)
font = ImageFont.truetype("./fonts/Asap_Condensed/AsapCondensed-Bold.ttf", 36) 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") 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)) blank = Image.open('./templets/O_mountain.png').convert('RGBA').resize((1920, 1080))
blank2 = Image.new('RGBA',(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) 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) 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 = Image.open('./.gen/Roth_Catch_Up.png')
IRAC = cords.scale(IRAC,0.265) 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 = Image.open('./.gen/Roth_IRA.png')
IRA = cords.scale(IRA,0.265) 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: if wb["O Mountain"]["B16"].value:
@ -66,13 +90,26 @@ def gen_O_Mountain(wb):
FSA = cords.scale(FSA,0.265) FSA = cords.scale(FSA,0.265)
blank2.paste(FSA, cords.center_on(FSA,(764,445)),FSA) 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) blank2 = Image.composite(blank2, Image.new('RGBA',(1920,1080)), O_Mountain_Mask2)
blank = Image.alpha_composite(blank,blank2) 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): def gen_Oh_I_Mountain(wb):
@ -87,3 +124,9 @@ def gen_Oh_I_Mountain(wb):
#Mask and combine #Mask and combine
Image.composite(blank, Oh_I_Mountain, Oh_I_Mountain_Mask).save("./gen/Oh_I_mountain.png") 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"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 939 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 KiB

After

Width:  |  Height:  |  Size: 234 KiB

Before After
Before After

BIN
templets/O_mountain_old.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB