This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainWindow.py
43 lines (35 loc) · 1.9 KB
/
mainWindow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import tkinter
from tkinter import filedialog
import procesingBatch
import procesing
import cv2
def show_image(inputPhoto):
#img = cv2.imread(inputPhoto, cv2.IMREAD_COLOR)
#cv2.imshow("uwu", img)
return True
def getImageInput():
global inputDialog
inputDialog = filedialog.askopenfilename(title="Select input file", filetypes=(("All files", "*.*"), ("png files", "*.png"),("jpg files", "*.jpg"), ("ico files","*.ico"), ("tif files", "*.tif"), ("gif files", "*.gif"), ("mp4 files", "*.mp4"), ("mov files","*.mov"), ("mkv files","*.mkv"), ("av1 files","*.av1"), ("avi files", "*.avi")))
def getImageOutputDir():
global outputDialog
outputDialog = filedialog.askdirectory(title="Select output path")
def window():
# Main GUI config
window = tkinter.Tk()
window.title('FidelityFX GUI')
window.iconbitmap('fsr_logo.ico')
window.geometry("500x300")
tkinter.Label(window, text= "FidelityFX Image Upscaler").pack()
photoButton = tkinter.Button(window, text="Select file", command=getImageInput).pack()
tkinter.Label(window, text= "Make sure file name doesn't include any spaces!").pack()
tkinter.Label(window, text= "").pack()
#outputButton = tkinter.Button(window, text= "Output path: (Don't put anything here for video upscaling!)", command=getImageOutputDir).pack()
tkinter.Label(window, text= "Upscale factor:").pack()
upscaleFactorEntry = tkinter.Entry(window)
upscaleFactorEntry.pack()
upscaleButton = tkinter.Button(window, text= "Upscale!", command= lambda: procesing.upscale(inputDialog, upscaleFactorEntry)).pack()
tkinter.Label(window, text= "Batch upscale factor:").pack()
upscaleFactorBatchEntry = tkinter.Entry(window)
upscaleFactorBatchEntry.pack()
batchUpscaleButton = tkinter.Button(window, text= "Upscale!", command= lambda: procesingBatch.batchUpscale(upscaleFactorBatchEntry, inputDialog)).pack()
window.mainloop()