-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
36 lines (31 loc) · 987 Bytes
/
main.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
import streamlit as st
import streamlit.components.v1 as components
import numpy as np
from PIL import Image
import os
import pandas as pd
class Converter():
def __init__(self) -> None:
self.color_dict = {}
class Web():
def __init__(self) -> None:
self.draw_text()
def draw_text(self):
st.set_page_config(
page_title="Pixelart-Converter",
page_icon="🖼️",
layout="centered",
initial_sidebar_state="expanded",
)
st.title("PixelArt-Converter")
self.upload = st.file_uploader("Upload Image", type=['jpg', 'jpeg', 'png', 'webp'])
self.original, self.converted = st.columns(2)
self.original.title("original img")
self.converted.title("convert img")
if __name__ == "__main__":
web = Web()
converter = Converter()
if web.upload != None:
img = Image.open(web.upload)
img = np.array(img)
web.original.image(web.upload)