python判断图片主色调,单个颜色:复制代码 代码如下:#!/usr/bin/env python# -*- coding: utf-8 -*-
import colorsysfrom PIL import Imageimport optparse
def get_dominant_color(image):“””Find a PIL image’s dominant color, returning an (r, g, b) tuple.“””
image = image.convert(‘RGBA’)
# Shrink the image, so we don’t spend too l
1