Spaces:
Sleeping
Sleeping
Update app.py
Browse files60 unmodified lines61626364656621 unmodified lines88899091929394959697989910010110210360 unmodified linespixel = img.getpixel((x, y))key = find_nearest_color_key(pixel)color_data = COLOR_RANGES[key]color = ((color_data["max"][0] + color_data["min"][0]) // 2,(color_data["max"][1] + color_data["min"][1]) // 2,21 unmodified linesreturn output_img# Interfaceiface = 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"]],)if __name__ == "__main__":60 unmodified lines6162636465666721 unmodified lines899091929394959697989910010160 unmodified linespixel = img.getpixel((x, y))key = find_nearest_color_key(pixel)color_data = COLOR_RANGES[key]# Use average of min/max as representative colorcolor = ((color_data["max"][0] + color_data["min"][0]) // 2,(color_data["max"][1] + color_data["min"][1]) // 2,21 unmodified linesreturn output_img# 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 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