Skip to content

With this script you can transfer the most prevalent n colours from one painting to the n colours of another one

Notifications You must be signed in to change notification settings

giovannicampa/colour_transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 

Repository files navigation

Colour transfer

This script takes two pictures as input and swaps their n most prominent characteristic colours.

The operations done to achieve this are

  1. Definition of the input pictures, and the parameter for the number of colours.
  2. Clustering of the colors on each picture with K-Means. It takes as input the color information of all pixels and finds the ones that can be grouped together.
  3. Rank the clusters by size and for each one calculate a representative RGB value.
  4. Swap the RGB values of the clusters in the two images.
  5. Smoothen the resulting image with a gaussian filter

Color swap

About

With this script you can transfer the most prevalent n colours from one painting to the n colours of another one

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages