Skip to content
Open

e #5

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e14b09f
added cat filter
mrobeidat Nov 25, 2021
14350a2
tkinter app
mrobeidat Nov 26, 2021
fd8a87c
added 3 stickers and one ghost filter
hayaa123 Nov 26, 2021
a2a6094
add image capture
mrobeidat Nov 26, 2021
18b29c8
Merge pull request #2 from Python-Hiss/new_filters
hayaa123 Nov 26, 2021
5b55336
change capture button size
mrobeidat Nov 26, 2021
2adc9aa
Merge branch 'main' into yousef
mrobeidat Nov 27, 2021
0854ceb
Merge pull request #3 from Python-Hiss/yousef
mrobeidat Nov 27, 2021
9529bf3
add camera and browse windows
mrobeidat Nov 27, 2021
2f3c91d
slove conflict
hayaa123 Nov 28, 2021
87d2cf7
editing
yahialabeeb Nov 28, 2021
2c61a78
edit
Nov 28, 2021
838988b
editing
yahialabeeb Nov 28, 2021
2ca7380
edit
Nov 28, 2021
71e5ddb
edit
Nov 28, 2021
90ee9a0
Merge branch 'main' into add_local
yaseen1998 Nov 28, 2021
0f1a41b
Merge pull request #11 from Python-Hiss/add_local
yaseen1998 Nov 28, 2021
5136d0a
change branch
hayaa123 Nov 28, 2021
0d45222
Merge branch 'add_local' into GUI
yaseen1998 Nov 28, 2021
a5cab3b
Merge pull request #12 from Python-Hiss/GUI
yaseen1998 Nov 28, 2021
b9fbe3c
Merge pull request #13 from Python-Hiss/GUI
yahialabeeb Nov 28, 2021
9150be0
edit
Nov 28, 2021
22613f7
merge GUI
Nov 29, 2021
17a8501
Merge pull request #15 from Python-Hiss/add_local
yaseen1998 Nov 29, 2021
955ced8
edit image background function
yahialabeeb Nov 29, 2021
167a2e5
Merge pull request #16 from Python-Hiss/GUI_Back_img
yahialabeeb Nov 29, 2021
b2af392
switch branch
hayaa123 Nov 29, 2021
46d2299
Merge pull request #17 from Python-Hiss/styling-Image
yahialabeeb Nov 30, 2021
59a9343
check
yahialabeeb Nov 30, 2021
85fbafd
finally I made a push
MohammadAl-khatib Nov 30, 2021
88b57f3
finally I made a push
MohammadAl-khatib Nov 30, 2021
8045b17
Merge pull request #18 from Python-Hiss/khatib
MohammadAl-khatib Nov 30, 2021
5c332d5
123
hayaa123 Nov 30, 2021
f4ac80c
almost finish the camera screen
hayaa123 Nov 30, 2021
0e15984
background image window designed
MohammadAl-khatib Nov 30, 2021
e27e1fc
Merge pull request #19 from Python-Hiss/khatib
MohammadAl-khatib Nov 30, 2021
abc46a6
edit live
Nov 30, 2021
c89d4f6
Merge branch 'main' into editing1
yaseen1998 Nov 30, 2021
22617df
Merge pull request #20 from Python-Hiss/editing1
yaseen1998 Nov 30, 2021
13deea4
edit
Nov 30, 2021
4e4fcbe
finish
Nov 30, 2021
3ee681b
switch branch
hayaa123 Nov 30, 2021
bcb2cb9
Merge branch 'main' of https://github.com/Python-Hiss/Filteristic int…
hayaa123 Nov 30, 2021
934ee96
finished buttons
hayaa123 Nov 30, 2021
7224e3f
Merge pull request #21 from Python-Hiss/stylingButtons
yaseen1998 Nov 30, 2021
51a93b5
finish project
Nov 30, 2021
28bdbac
edit
Dec 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .idea/Filteristic.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ Featured task: different filter names must appear to the user

<h2 style= "color:#23968b">Domain Modeling</h2>

[white board](https://miro.com/app/board/o9J_lgjUC2c=/)
[white board ](https://miro.com/app/board/o9J_lgjUC2c=/)
Binary file added Tkinter/123.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Tkinter/Cat03.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions Tkinter/GUI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import tkinter as tk
from tkinter import filedialog, Text
import os, sys, subprocess
# from tkinter import *
from tkinter.ttk import *
from tkinter import *
from PIL import Image, ImageTk
import time
import cv2
from Tkinter.GUI_Live import camera
from tkinter_custom_button import TkinterCustomButton
from GUI_background import background_window

# from snapshot import App, videoCapture
root = tk.Tk()
images = []
from Tkinter.GUI_Image import importWindowyahia


######### filter image Window ##########

def importFilterWindow(new):
importWindowyahia(new)

######### background image Window ##########

def backgroundWindow(new):
background_window(new)

######### import Window ##########

def importWindow():
importWindow = Toplevel(root)
root.withdraw()
importWindow.title("Import Window")
importWindow.geometry("700x400")
Label(importWindow, text="", font=("Arial", 50)).pack()
Label(importWindow,text="Editing Type", font=("Arial", 25)).pack()
Label(importWindow, text="", font=("Arial", 25)).pack()

filterButton = TkinterCustomButton(master =importWindow, text="Add Filter", corner_radius=5, command= lambda: importFilterWindow(importWindow),
fg_color="#FF5C58", hover_color="#ff544f", width=300,
cursor="shuttle", text_font=("sans-serif", 20))
filterButton.pack()

Label(importWindow, text="", font=("Arial", 25)).pack()

backgroundButton = TkinterCustomButton(master=importWindow, text="Add Background", corner_radius=5, command=lambda: backgroundWindow(importWindow),
fg_color="#FF5C58", hover_color="#ff544f", width=300,
cursor="shuttle", text_font=("sans-serif", 20))

backgroundButton.pack()

def on_closing():
importWindow.destroy()
root.deiconify()

importWindow.protocol("WM_DELETE_WINDOW", on_closing)

image = PhotoImage(file='../assest/back.png')
backButton = TkinterCustomButton(master=importWindow, corner_radius=15,
command=on_closing, fg_color="#f1f1f1", hover_color="#c1c1c1", cursor="shuttle",
image=image, width=50)

backButton.place(x=0, y=3)

########### second-window #############

def videoWindow():
cameraWindow = Toplevel(root)
root.withdraw()
cameraWindow.title("New Window")
# cameraWindow.geometry("700x700")
camera(cameraWindow)


######## Back to previous window ########
def on_closing():
cameraWindow.destroy()
root.deiconify()

image= PhotoImage(file ='../assest/back.png')
backButton = TkinterCustomButton(master=cameraWindow, corner_radius=15,
command=on_closing, fg_color="#f1f1f1", hover_color="#c1c1c1", cursor="shuttle", image=image,
width=50)
backButton.place(x=0,y=3)


cameraWindow.protocol("WM_DELETE_WINDOW", on_closing)



########## Home-Page ##########
root.geometry("960x630")
image= PhotoImage(file ='../assest/2.png',width=960,height=540)
Label(root, image= image).grid(column=0,row=0,columnspan=2)
Label().grid(column=0,row=1)
importButton =TkinterCustomButton(text="Image", corner_radius=5, command=importWindow,fg_color="#FF5C58",hover_color="#ff544f",width=300,
cursor="shuttle",text_font=("sans-serif", 20))
importButton.grid(row=2,column=0)
Label().grid(column=1,row=1)
cameraButton= TkinterCustomButton(text="Camera", corner_radius=5, command=videoWindow,fg_color="#FF5C58",hover_color="#ff544f",width=300,
cursor="shuttle",text_font=("sans-serif", 20))
# cameraButton.place(relx=0.5, rely=0.5, anchor=CENTER)
cameraButton.grid(row=2,column=1)


###########################################
root.mainloop()
140 changes: 140 additions & 0 deletions Tkinter/GUI_Image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import tkinter as tk
from tkinter import filedialog, Text
import os, sys, subprocess
from filters_image.change_filter import change_filter
from tkinter.ttk import *
from tkinter import *
from PIL import Image, ImageTk
from filters_image.image_filtering_face import image_filtering_face
import cv2
from tkinter_custom_button import TkinterCustomButton
# root = tk.Tk()
images = []
count = 0
next = False
entry = ""
######### import Window ##########



# mainloop()



def importWindowyahia(root):
newWindow = Toplevel(root)
def browse():
global count


filename = filedialog.askopenfilename(title="select File",
filetypes = (("all files","*.*"),("jpeg files","*.jpg"),('png files', '*.png')))
images.append(filename)
img = Image.open(images[-1])
img = img.resize((500, 500))
img = ImageTk.PhotoImage(img)
img_label = Label(newWindow, image=img)
img_label.photo = img
img_label.place(x=228, y=40)

filtering = TkinterCustomButton(master=newWindow,text="Add Filter", corner_radius=5,command=lambda: image_filter(filename, newWindow),
fg_color="#FF5C58",hover_color="#ff544f", width=200,cursor="shuttle", text_font=("sans-serif", 20))
filtering.place(x=380, y=550)




root.withdraw()
newWindow.title("New Window")
newWindow.geometry("960x630")
browse_button = TkinterCustomButton(master=newWindow,text="Browse", corner_radius=5, command=browse,
fg_color="#FF5C58",hover_color="#ff544f", width=200, cursor="shuttle",
text_font=("sans-serif", 20))


browse_button.pack()


######## Back to previous window ########
def on_closing():
newWindow.destroy()
root.deiconify()
image= PhotoImage(file ='../assest/back.png')
backButton = TkinterCustomButton(master=newWindow, corner_radius=15,
command=on_closing,fg_color="#f1f1f1",hover_color="#c1c1c1", cursor="shuttle",image=image,width=50)

backButton.place(x=0,y=3)

newWindow.protocol("WM_DELETE_WINDOW", on_closing)

def render(image_withfilter):
image_withfilter = cv2.cvtColor(image_withfilter, cv2.COLOR_BGR2RGB)
img = Image.fromarray(image_withfilter)
img = img.resize((500, 500))
img = ImageTk.PhotoImage(img)
img_label = Label(newWindow, image=img)
img_label.photo = img
img_label.place(x=228, y=40)
# photo = ImageTk.PhotoImage(image=Image.fromarray(image_withfilter))
# canvas.create_image(0, 0, anchor="nw", image=photo)

def next_fun(path):
global count

images.append(image_filtering_face(
change_filter[count]['filter'],
path,
change_filter[count]['center'],
change_filter[count]['width'],
change_filter[count]['height'],
change_filter[count]['up'],
change_filter[count]['left'],
change_filter[count]['counte']
))
count += 1
if count == len(change_filter):
count = 0
render(images[-1])

def submit(content,top):
global entry
entry1 = entry.get()
imgdir = f"../saved/{entry1}.png"
cv2.imwrite(imgdir, content)
entry.delete(0, END)
top.destroy()
def saving(content, newWindow):
pass
def image_filter(path, newWindow):
global count
images.append(
image_filtering_face(
change_filter[count]['filter'],
path,
change_filter[count]['center'],
change_filter[count]['width'],
change_filter[count]['height'],
change_filter[count]['up'],
change_filter[count]['left'],
change_filter[count]['counte']
))
save = TkinterCustomButton(master=newWindow, text="Save", corner_radius=5,
command=lambda: open_popup(images[-1],newWindow), fg_color="#FF5C58",hover_color="#ff544f", width=200, cursor="shuttle", text_font=("sans-serif", 20))
save.place(x=50, y=550)
next = TkinterCustomButton(master=newWindow, text="Next", corner_radius=5,
command=lambda: next_fun(path), fg_color="#FF5C58",hover_color="#ff544f", width=200, cursor="shuttle", text_font=("sans-serif", 20))
newWindow.bind("<Right>", lambda x: next_fun(path))
next.place(x=710, y=550)
render(images[-1])

def open_popup(content,newWindow):
top = Toplevel(newWindow)
top.geometry("250x150")
top.title("save")
global entry
sub_btn = TkinterCustomButton(master=top, text="Submit", corner_radius=5, command=lambda: submit(content,top),
fg_color="#2da44e",hover_color="#24843f", width=100,
cursor="shuttle", text_font=("sans-serif", 20))
entry = tk.Entry(top, width=20, bg="white")
entry.place(x=75, y=10)
sub_btn.place(x=75, y=50)
Loading