Spaces:
Sleeping
Sleeping
Update app.py
Browse files60 unmodified lines6162636465666721 unmodified lines8990919192939495969697989910097989910010160 unmodified lines pixel = img.getpixel((x, y)) key = find_nearest_color_key(pixel) color_data = COLOR_RANGES[key] # Use average of min/max as representative color color = ( (color_data["max"][0] + color_data["min"][0]) // 2, (color_data["max"][1] + color_data["min"][1]) // 2,21 unmodified lines return output_img
# Interface# Interface — NO EXAMPLES, just clean uploadiface = gr.Interface( fn=process_image, inputs=gr.Image(type="pil"), outputs=gr.Image(type="pil"), title="Color By Number Pixel Art", description="Upload an image and get a color-by-number pixel art version with numbers. Colors are grouped by range.", examples=[ ["https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Spider-Man_2017.jpg/220px-Spider-Man_2017.jpg"] ], title="🎨 Color By Number Pixel Art", description="Upload any image → Get a printable color-by-number pixel art with symbols. Colors are grouped by range (e.g., all reds → '7').")
if __name__ == "__main__":app.py+4-6