-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnormalmap_top.py
More file actions
25 lines (18 loc) · 809 Bytes
/
normalmap_top.py
File metadata and controls
25 lines (18 loc) · 809 Bytes
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
import tkinter as tk
from PIL import Image
import normalmap as nm
from common_widgets import SaveTexture
class Normalmap_Top(tk.Toplevel):
def __init__(self, parent, path, size_selected):
super().__init__(parent)
self.parent = parent
self.title("Normalmap Top")
self.geometry('260x312')
self.resizable(False, False)
self.path = path
self.im = Image.open(self.path).convert("L")
self.size = size_selected
self.im_normal = nm.grayscale_to_normalmap(self.im)
self.im_normal_preview = self.im_normal.resize((256, 256))
self.save_widget = SaveTexture(self, 'Normalmap', 'Save', self.im_normal_preview, self.im_normal, size_selected)
self.save_widget.grid(row=6, column=0, columnspan=3, sticky='we')