This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@WebServlet(value = "/*", asyncSupported = true) | |
@VaadinServletConfiguration(productionMode = false, ui = MyVaadinUI.class) | |
public static class MyCORSServlet extends VaadinServlet { | |
/** | |
* Override to handle the CORS requests. | |
*/ | |
@Override | |
protected void service(HttpServletRequest request, | |
HttpServletResponse response) throws ServletException, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageDraw | |
import argparse | |
import sys | |
def get_colors(image_file, numcolors=10, resize=150): | |
# Resize image to speed up processing | |
img = Image.open(image_file) | |
img = img.copy() | |
img.thumbnail((resize, resize)) |