File size: 520 Bytes
63495b1
9a7103b
7c2306e
9a7103b
 
 
7c2306e
9a7103b
 
 
 
 
7c2306e
9a7103b
7c2306e
9a7103b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from PIL import Image

def to_black_and_white(input_image):
    bw_image = input_image.convert("L")  # Convert to grayscale
    return bw_image

with gr.Blocks() as app:
    gr.Markdown("### Black and White Image Maker")
    with gr.Row():
        image_input = gr.Image(type="pil", label="Upload your Image")
        image_output = gr.Image(type="pil", label="Black and White Image", tool="editor")

    image_input.change(to_black_and_white, inputs=image_input, outputs=image_output)

app.launch()