AfarX

A Rookie of R.

收藏夹整理

一直想着把乱糟糟的收藏夹整理一下,一直也没做,趁着在家摸鱼,来整理一波吧!

整理收藏夹的过程也是对过去的梳理(毕竟对于一个社交恐惧症患者……网络生活基本就是我的全部生活了……),所以有很多碎碎念~hhh~


设计类

配色

  1. Color hunt http://colorhunt.co/
    一个配色网站,附HEX码,很美丽!
  2. nipponcolor
    http://nipponcolors.com/
    日系配色网站,网站本身就美。
  3. ColorBrewer
    http://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3
  4. 中国传统色彩
    http://ylbook.com/cms/web/chuantongsecai/chuantongsecai.htm

使用R提取图像主要颜色

前言

Recently, I was amazed by the fantastic art of data visualization created by Namier and Shirley. Namier showed her working process of Cardcaptor Sakura, and I read the passages as below :

Using the imager package in R, I loaded the images into R where each pixel was transformed into a multidimensional array of RGBA values. I converted that complex array into a more simple data frame of (number of pixels) * 3 (for r, g, and b value) size. To figure out which algorithm would cluster the pixel values into decent colors groups I tried several things. First I experimented with using different clustering techniques: from the standard K-means, to hierarchical clustering and even tSNE. But I also converted the RGB values of each pixel into other color spaces (where colors have different “distances” to each other and can thus result into different clustering results), using, amongst others, the colorspace package.
I often converted the results of each test into a bar chart such as below to see the color groups found. Eventually, I found that using Kmeans together with the colors converted to “Lab” visually gave the best fitting results.

I thought though I am not famliar with D3.js (so hard, but I want to acknowledge it one day, as it is so coooool!), I have a basis of using R. So, I want to try those two packages, ‘imager’ and ‘colorspace’, to select main colors from a targeted picture, and maybe draw a bar chart like Nadieh had done.