Coder Social home page Coder Social logo

photoshop-plugin-sample's Introduction

本demo使用了官方SDK中自带的demo作为基础,然后参考了别人的教程,然后 debug debug debug 而成

编译需求:

  1. Photoshop CC 2017
  2. Photoshop CC 2017 SDK
  3. VS 2015

安装方式:

编译之后将Output目录下的8bf文件复制到Photoshop安装目录下的Plug-ins文件夹下

(在我的电脑上对应目录为C:\Program Files\Adobe\Adobe Photoshop CC 2017\Plug-ins\)

重启Ps之后,在顶部菜单里就可以看到 滤镜>AdobeSDK>ColorMunger 选项

操作像素

DoContinue里操作像素,可以取出RGBA进去需要的处理. 此处是把灰度低于180的像素点直接给删除(调成透明的)

float gray = ( 299*r +  587*g + 114*b + 500) / 1000;
uint8 p = 60;
if(gray<180){
    //pDataOut[indexOut] = 0;//Red  
    //pDataOut[indexOut + 1] = 0;//Green 
    //pDataOut[indexOut + 2] = 0;//Blue
    pDataOut[indexOut + 3] = 255;
}
else {
    pDataOut[indexOut] = 255;//Red  
    pDataOut[indexOut + 1] = 0;//Green 
    pDataOut[indexOut + 2] = 0;//Blue
    pDataOut[indexOut + 3] = 0;
}

相关参考链接:

  1. 对Photoshop第三方滤镜插件开发的简介
  2. Adobe CEP 开发

photoshop-plugin-sample's People

Contributors

wangyhzzz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.