clc;
clear all;
close all;
addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm');
Image=imread('4.jpg');
Image=double(Image)/255;
r=Image(:,:,1);
g=Image(:,:,2);
b=Image(:,:,3);
blueGreen=0.5;
redBlue=0.5;
greenRed=0.5;
intoR=0.75;
intoG=0.25,
intoB=0.25;
N_R=(intoR * (blueGreen*g+(1-blueGreen)*b) + (1-intoR)*r);
N_G=(intoG * (redBlue*b+(1-redBlue)*r) + (1-intoG)*g);
N_B=(intoB * (greenRed*r+(1-greenRed)*g) + (1-intoB)*b);
Img_new(:, :, 1)=N_R;
Img_new(:, :, 2)=N_G;
Img_new(:, :, 3)=N_B;
imshow(Img_new);
imwrite(Img_new, 'out.jpg');
参考来源:http://www.jhlabs.com/index.html
原图:
效果图: