Update app.py
Browse files
app.py
CHANGED
@@ -62,11 +62,7 @@ def generate_palette_image(colors):
|
|
62 |
img = Image.new('RGB', (color_width, img_height), color)
|
63 |
palette_img.paste(img, (i * color_width, 0))
|
64 |
|
65 |
-
#
|
66 |
-
buf = BytesIO()
|
67 |
-
palette_img.save(buf, format='PNG')
|
68 |
-
buf.seek(0)
|
69 |
-
return buf
|
70 |
|
71 |
# Function to generate the CSS code for the color palette
|
72 |
def generate_css_code(colors):
|
@@ -114,7 +110,7 @@ with gr.Blocks() as interface:
|
|
114 |
|
115 |
with gr.Column():
|
116 |
palette_output = gr.HTML(label="Generated Color Palette")
|
117 |
-
palette_image_output = gr.Image(label="Downloadable Palette Image")
|
118 |
css_code_output = gr.Textbox(label="Generated CSS Code", lines=6) # Use Textbox to display CSS code
|
119 |
|
120 |
submit_btn.click(gradio_interface, inputs=[image_input], outputs=[
|
|
|
62 |
img = Image.new('RGB', (color_width, img_height), color)
|
63 |
palette_img.paste(img, (i * color_width, 0))
|
64 |
|
65 |
+
return palette_img # Return the PIL image directly
|
|
|
|
|
|
|
|
|
66 |
|
67 |
# Function to generate the CSS code for the color palette
|
68 |
def generate_css_code(colors):
|
|
|
110 |
|
111 |
with gr.Column():
|
112 |
palette_output = gr.HTML(label="Generated Color Palette")
|
113 |
+
palette_image_output = gr.Image(label="Downloadable Palette Image", type="pil") # Output PIL image
|
114 |
css_code_output = gr.Textbox(label="Generated CSS Code", lines=6) # Use Textbox to display CSS code
|
115 |
|
116 |
submit_btn.click(gradio_interface, inputs=[image_input], outputs=[
|