🔍

首页Home › 图片工具Image Tools

🎨 提取 WebP 调色板Extract WebP Colour Palette

用中位切分(median-cut)从 WebP 的真实像素中找出代表色(每组像素的平均色,忽略完全透明的像素),生成带十六进制标签的色板图片(WebP 或 PNG),并列出可复制的颜色、像素数和占比。本地处理。Find the representative colours of a WebP with median cut on its actual pixels (each colour is the average of a group of pixels; fully transparent pixels are ignored). You get a palette image with hex labels (WebP or PNG) and a copyable list of colours with pixel counts and percentages. Processed locally.

点击选择或拖放图片(可多选)Click or drop images here (multiple allowed)

使用说明与常见问题How-to & FAQ

「提取 WebP 调色板」是什么?What is the Extract WebP Colour Palette tool?

用中位切分(median-cut)从 WebP 的真实像素中找出代表色(每组像素的平均色,忽略完全透明的像素),生成带十六进制标签的色板图片(WebP 或 PNG),并列出可复制的颜色、像素数和占比。本地处理。Find the representative colours of a WebP with median cut on its actual pixels (each colour is the average of a group of pixels; fully transparent pixels are ignored). You get a palette image with hex labels (WebP or PNG) and a copyable list of colours with pixel counts and percentages. Processed locally.

如何使用「提取 WebP 调色板」?How do I use the Extract WebP Colour Palette tool?

在「提取 WebP 调色板」中,选择或拖入文件,按需设置「颜色数」、「输出格式」等选项,然后点击「复制颜色列表」、「全部下载(ZIP)」按钮即可。In the Extract WebP Colour Palette: Choose or drop your files, set "Colours", "Format", then click "Copy colour list", "Download all (ZIP)".

为什么只导出 WebP?Why does it only export WebP?

本页是 WebP 系列工具之一:读入图片后统计出现最多的颜色并生成 2–32 色的色板(透明像素不计),再按 WebP 格式导出,便于在 WebP 工作流里直接使用。需要 PNG 或 JPG 结果时,请用对应的通用图片工具。This page is one of the WebP tools: it loads the image, counts the most common colours and builds a palette of 2 to 32 colours (transparent pixels are skipped), and exports the result as WebP so it fits straight into a WebP workflow. For PNG or JPG output, use the matching general image tool.

会上传吗?Is anything uploaded?

不会,图片只在浏览器本地处理。No. Images are processed locally in your browser.

颜色是怎么算出来的?How are the colours worked out?

图片里的不同颜色不超过所选颜色数时,直接按原值列出每种颜色和精确的像素数;否则用中位切分:把所有非完全透明的像素按颜色范围最大的通道反复对半分组,分到所选的颜色数为止,每组取像素的平均色,然后再做几轮“把每个像素重新分给最近的颜色、重算平均色”的优化,避免把两种不同的颜色混成一个中间色,所以结果是图片里真实的代表色(例如纯色 (200,30,30) 的图片得到 #c81e1e)。WebP 文件用内置的 libwebp 解码器直接读取像素(选择文件后才加载),不经过浏览器画布;其他格式经画布读取,如果浏览器读回时加了 ±1–2 的微小噪点,几乎相同的颜色会先合并。超过 100 万像素的图片会均匀取样。When the image has no more distinct colours than you asked for, each colour is listed as it is, with its exact pixel count. Otherwise median cut is used: all pixels that are not fully transparent are split in half again and again along the channel with the widest range until there are as many groups as you asked for, and each colour is the average of its group. A few refinement rounds then reassign every pixel to its nearest colour and recompute the averages, so two different colours are not blended into an in-between one. The results are real colours from the image (a solid (200,30,30) image gives #c81e1e). WebP files are read by a built-in libwebp decoder (loaded after you choose a file) rather than the browser canvas; other formats go through the canvas, and if the browser adds tiny ±1–2 read-back noise, near-identical shades are merged first. Images above 1 million pixels are sampled evenly.

下载的是什么?What do I download?

一张色板图片:每个颜色一个色块,下面标出十六进制值和占比;可选 WebP(无损)或 PNG。颜色、像素数和占比的列表也可以直接复制。A palette image with one swatch per colour, labelled with its hex value and share; choose WebP (lossless) or PNG. The list of colours, pixel counts and shares can also be copied.

有哪些选项可以调整?What options can I adjust?

「颜色数」默认 8,范围 2–32(须为整数,超出范围会调整并提示);「输出格式」可选 WebP 或 PNG(默认 WebP),两种都是无损的,所以没有质量选项。可选文件:常见图片格式(含 HEIC、HEIF、AVIF、WEBP、BMP、JFIF)。每次生成结果都按当前设置处理。"Colours" defaults to 8 with a range of 2–32 (whole numbers; values outside the range are adjusted with a note); "Format" is WebP or PNG (WebP by default). Both are lossless, so there is no quality setting. Files: common image formats (including HEIC, HEIF, AVIF, WEBP, BMP, JFIF). The result always uses the current settings.

「提取 WebP 调色板」免费吗?需要注册吗?Is the Extract WebP Colour Palette free? Do I need an account?

「提取 WebP 调色板」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Extract WebP Colour Palette is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.

相关工具Related tools

🔢 十六进制转 WebPConvert Hex to WebP✏️ 文字转 WebPConvert Text to WebP⬜ 创建空白 WebPCreate Empty WebP🟦 创建不透明 WebPCreate Opaque WebP👻 创建半透明 WebPCreate Transparent WebP🅰️ 创建 WebP Alpha 遮罩Create WebP Alpha Mask🔢 WebP 转十六进制Convert WebP to Hex🎨 提取 WebP 像素颜色Extract WebP Colour🪣 填充透明 WebPFill Transparent WebP🅰️ 填充 WebP AlphaFill WebP Alpha Channel📐 查看 WebP 尺寸Find WebP Dimensions📦 查看 WebP 体积Find WebP File Size

← 全部工具All tools