摘要:本文主要向大家介绍了Photoshop入门学习之PS 图像调整算法——渐变映射,通过具体的内容向大家展现,希望对大家Photoshop入门学习有所帮助。
本文主要向大家介绍了Photoshop入门学习之PS 图像调整算法——渐变映射,通过具体的内容向大家展现,希望对大家Photoshop入门学习有所帮助。
<
这个调整简单来说就是先建立一张lookup table, 然后以图像的灰度值作为索引,映射得到相应的颜色值。图像的灰度值是由图像本身决定的,但是lookup table 却可以各种各样,所以不同的lookup table 就能使图像最终呈现的色彩不一样。
clc;
clear all;
close all;
Image=imread('4.jpg');
size_info=size(Image);
height=size_info(1);
width=size_info(2);
%% 图像转为灰度图
Gray_Img=rgb2gray(Image);
%% 建立 lookup table
row=50;
col=256;
Color(:,:,1)=rand(row,col);
Color(:,:,2)=rand(row,col);
Color(:,:,3)=rand(row,col);
for index=1:col
val=index/col;
%% color 1
% % % Color(:,index,1)=3*(val);
% % % Color(:,index,2)=3*(val)-1;
% % % Color(:,index,3)=3*(val)-1;
%% color 2
Color(:,index,1)=sin(val);
Color(:,index,2)=sin(val/2);
Color(:,index,3)=sin(val/3);
%% color 3
% % % Color(:,index,1)=val;
% % % Color(:,index,2)=val;
% % % Color(:,index,3)=0;
end
figure, imshow(Color);
%% 以灰度值为索引,映射得到相应的颜色值。
Image_new=double(Image);
for ii=1:height
for jj=1:width
index=Gray_Img(ii,jj);
Image_new(ii,jj,:)=Color(1, index, :);
end
end
figure, imshow(Image_new);
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注常用软件Photoshop频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号