zoukankan      html  css  js  c++  java
  • PS图像特效算法——镜像渐隐

    这个特效的实现,可以先利用前面提到的渐变特效,做一个图像的渐变, 然后将原图与渐变图对称放置,将背景设置成黑色。


    clc;
    clear all;
    close all;

    Image=imread('4.jpg');
    Image=double(Image)/255;
    size_info=size(Image);  
    height=size_info(1);  
    width=size_info(2);  

    Map=zeros(height, width);
    for row_i=1:height
        Map(row_i, :)=row_i/height*0.75;
    end
    Img_1=Image;
    for kk=1:3
          Img_1(:,:,kk)=Image(:,:,kk).*Map;
    end
    % % figure, imshow(Img_1);
    Img_2=Img_1;
    for ii=1:height
        Img_2(ii,:,:)=Img_1(height+1-ii,:,:);
    end
    % % figure, imshow(Img_2);

    %% 缩放要注意,不要超出背景图的尺寸
    small_1=imresize(Image, 0.45);
    small_2=imresize(Img_2, 0.45);

    Canvas=zeros(height, width, 3);
    l_row=floor(height/2);
    l_col=floor(width/4);

    %% 将图像对称放置
    Canvas(l_row:l_row+size(small_1,1)-1,l_col:l_col+...
                       size(small_1,2)-1,: )=small_2;    
    Canvas(l_row-size(small_1,1):l_row-1,l_col:l_col+...
                       size(small_1,2)-1,: )=small_1;      
    figure, imshow(Canvas);


    原图:



    效果图:






  • 相关阅读:
    [Panzura] identify user operations(copy, open, read ... ) in audit log
    Spark 学习
    Zeppelin 学习
    Delta Lake 学习
    传染病模型 SI
    xcodebuild和xcrun实现自动打包iOS应用程序
    控制UIlabel 垂直方向对齐方式的 方法
    ALAssetsLibrary
    CATransform3D
    AVFoundation的使用
  • 原文地址:https://www.cnblogs.com/muyuge/p/6152387.html
Copyright © 2011-2022 走看看