The Code is in Two parts and both are matlab implementations.

part 1 is in "colorization" directory
part 2 is in "colorization_optimization" directory

part 1 is implemented by me. It requires a reference color image and a target grayscale image.
part 1 can be used either to fully or partially colorize results using threshold as describe below.

part 2 is optimization part of the project and contains an implementation of the image colorization approach described in the paper:
	A. Levin D. Lischinski and Y. Weiss Colorization using Optimization.

I have obtained part 2 code from website "http://www.cs.huji.ac.il/~yweiss/Colorization/"

Only Use this code to fully colorize gray image if you are partially colorizing in part 1
	

Part 1: 
Not very optimized code.

Usage -

1)	read reference color image :: syntax :: I = im2double(imread("path1"));
2)  read target grayscale image:: syntax :: J = im2double(imread("path2"));
	Note: grayscale image (J) must be a 2D matrix

3)  use function "Colorize" to colorize
	syntax:: 	
	a) To fully colorize the target gray image

	L = Colorize(I,J);
	imshow(L);

	b) To partially colorize gray image with some threashold

	thresh = floating value in range 0-1

	L = Colorize(I,J,thresh);
	imshow(L);

4) use command imwrite(L,'filename.jpg')  to save colored image


part 2: 
 
	The folder contains another README on detailed usage of this code

	Usage:
	1) Open colorize.m 
	2) change 
			g_name  = "path of gray scale image"  
					   This MUST be 3 dimentional Matrix


			c_name =  "path of partially colored image from part 1"

			out_name = "output file name"

	4) set ::   solver = 1 or solver = 2  (by default 2)

			1)An exact solver using the matlab "\" operator.
			  This solver is guarantee to provide the global optimum, but running
			  time can be slow, especially for large images.

			2)Multi Grid solver. Fast and efficient, but not always accurate. 
			  This solver is written in C++ and links to matlab as a mex function.

	5) Run sript colorize.m


