All Projects → b-z → photo_recoloring

b-z / photo_recoloring

Licence: other
Palette-based Photo Recoloring, implementation of the approach of Huiwen Chang et al.

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to photo recoloring

Rose Pine Theme
All natural pine, faux fur and a bit of soho vibes for the classy minimalist
Stars: ✭ 143 (+266.67%)
Mutual labels:  palette
Chartjs Plugin Colorschemes
Predefined color schemes for Chart.js
Stars: ✭ 189 (+384.62%)
Mutual labels:  palette
bichon
Robust Coarse Curved TetMesh Generation
Stars: ✭ 29 (-25.64%)
Mutual labels:  siggraph
Vue Tiny Code
这里有一个仿 Chrome 调色盘,有一个拖动排版的页面,还有一些新奇的小点子。
Stars: ✭ 170 (+335.9%)
Mutual labels:  palette
Webgradients
A curated collection of splendid gradients made in CSS3, .sketch and .PSD formats.
Stars: ✭ 2,197 (+5533.33%)
Mutual labels:  palette
Vaporwave
📼👾🕹Vaporwave themes and color palettes for ggplot2💾👨‍🎤📺
Stars: ✭ 215 (+451.28%)
Mutual labels:  palette
Calico
cat, but for colors 😼
Stars: ✭ 122 (+212.82%)
Mutual labels:  palette
OpenISS
OpenISS -- a unified multimodal motion data delivery framework.
Stars: ✭ 22 (-43.59%)
Mutual labels:  siggraph
Styled Theme
Extensible theming system for styled-components 💅
Stars: ✭ 183 (+369.23%)
Mutual labels:  palette
Md Color Picker
Angular-Material based color picker
Stars: ✭ 253 (+548.72%)
Mutual labels:  palette
Color Thief Java
Grabs the dominant color or a representative color palette from an image. A very fast Java port of Lokesh Dhakar's JavaScript version.
Stars: ✭ 178 (+356.41%)
Mutual labels:  palette
Jscolor
JavaScript color picker with opacity (alpha channel) and customizable palette. Single file of plain JS with no dependencies.
Stars: ✭ 182 (+366.67%)
Mutual labels:  palette
Themify
👨‍🎨 CSS Themes Made Easy. A robust, opinionated solution to manage themes in your web application
Stars: ✭ 218 (+458.97%)
Mutual labels:  palette
Tachyons Tldr
quick lookup for tachyon classes, scales and colour palette
Stars: ✭ 170 (+335.9%)
Mutual labels:  palette
Krypton-Toolkit-Suite-Extended-NET-5.470
An extension to the Krypton Toolkit suite of controls for .NET framework 4.7
Stars: ✭ 51 (+30.77%)
Mutual labels:  palette
Glidepalette
Android Lollipop Palette is now easy to use with Glide
Stars: ✭ 1,670 (+4182.05%)
Mutual labels:  palette
Haishoku
A development tool for grabbing the dominant color or representative color palette from an image
Stars: ✭ 214 (+448.72%)
Mutual labels:  palette
tailwind-css-palette-generator
10-color Palette Generator and API for Tailwind CSS
Stars: ✭ 206 (+428.21%)
Mutual labels:  palette
Ciapre.tmTheme
Ciapre - an easy-on-the-eyes Sublime Text/TextMate color scheme.
Stars: ✭ 63 (+61.54%)
Mutual labels:  palette
Use Image Color
🎨 A hook to grab a color palette from images. Render a skeleton color while your original image still loading.
Stars: ✭ 222 (+469.23%)
Mutual labels:  palette

photo_recoloring

实现了Huiwen Chang et al. 的论文"Palette-based Photo Recoloring, ACM SIGGRAPH 2015"

Zhou Bowei
2015.12.26


一、使用方法

直接打开index.html或者访问http://b-z.github.io/photo_recoloring
从相册中选择合适图片上传,程序将自动计算调色板。
待计算完成,可点击调色板编辑变换的目标颜色。
编辑完后,点击CONFIRM按钮开始重着色。

二、算法实现

2.1 调色板计算
  • 将RGB颜色空间均匀分成$16\times 16\times 16$个bins,统计图像中属于各个bin的颜色个数。每个bin的RGB空间均值为其代表色
    (注: 原文为Lab空间均值,但求该均值较复杂,故使用了差别不大的RGB均值)。
  • 对bin进行聚类,使用的方法是改进的K-means算法。
  • 在聚类前,规定黑色为调色板颜色之一,这样可避免生成的调色板中有很多暗色。
  • 将聚类得到的调色板颜色按照Lab亮度升序排序。
2.2 重着色
  • 单个的颜色变换可以看成颜色在L通道与a、b通道单独变换的组合。
  • L通道的变换由对调色板亮度线性插值得到。
  • ab通道的变换(左下图)由颜色在Lab空间内平移得到。其中对于超出Lab边界的情况做了特殊处理
  • 一组颜色变换可以看做是若干个单独颜色变换的组合(右下图),文章给出了使用径向基函数分配权重的方法: $$f(x)=\sum_i^k \omega _i(x) f_i(x)$$ $$\omega i(x)=\sum_j^k\lambda{ij}\phi(\parallel x-C_j\parallel)$$ $$\phi(r)=e^{-\frac{r^2}{2\sigma_r^2}}$$
   

三、主要函数及说明

函数 位置 说明
Color.lab2rgb(InputColor) color.js 将RGB颜色转换为Lab颜色($RGB\to XYZ\to Lab$)
Color.rgb2lab(InputColor) color.js 将Lab颜色转换为RGB颜色
Color.labBoundary(pin, pout) color.js 在Lab空间内,求颜色pin与pout连线与Lab边界的交点(二分查找)
Palette.palette() palette.js 统计图像颜色属于各个bin的颜色个数
Palette.kmeansFirst() palette.js 聚类,由统计好的bins数据得到调色板
Palette.kmeans() palette.js 调整上一步聚类得到的颜色,直到调色板不再变化
Palette.colorTransformSingleL(l) palette.js 根据调色板颜色亮度,确定新图像亮度的变化
Palette.colorTransformSingleAB(ab1,ab2,L,x) palette.js 在Lab空间某一亮度的层内,根据论文方法,由$ab1\to ab2$这一对颜色变换,对x做a、b通道的颜色变换
Palette.colorTransform(colors1,colors2) palette.js 综合几组颜色变换的结果,得到新的图片

Gallery



两天写完 都是DDL逼的(╯-_-)╯╧╧

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].