Compare commits
No commits in common. "f70b063d2ff545cd89095534a409718480582358" and "812fd90e72fb4a512e7b77b7206e672fc9c7a056" have entirely different histories.
f70b063d2f
...
812fd90e72
BIN
Numbers.xlsx
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
63
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"
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 939 KiB After Width: | Height: | Size: 205 KiB |
|
Before Width: | Height: | Size: 234 KiB After Width: | Height: | Size: 243 KiB |
|
Before Width: | Height: | Size: 243 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 58 KiB |