图像处理:软光算法,如Photoshop [英] Image processing: Soft-Light algorithm like Photoshop

查看:184
本文介绍了图像处理:软光算法,如Photoshop的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从头就从Adobe的文档的Andr​​oid基地发展软光算法:
<一href=\"http://www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pdf_reference_archives/blend_modes.pdf\" rel=\"nofollow\">http://www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pdf_reference_archives/blend_modes.pdf
http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/SoftLight.pbk

能否给我任何解释的算法或者至少 DST,SRC,CB,CS 是sampleNearest()功能以及如何计算呢?
谢谢你!

 输入图片4 DST;
输入图片4 SRC;
输出pixel4结果;空虚
evaluatePixel()
{
    pixel4一个=是sampleNearest(DST,outCoord()); // CB
    pixel4 B =是sampleNearest(SRC,outCoord()); // CS
    ....
}


解决方案

见对于混合式这个答案

  ChannelBlend_SoftLight(A,B)((UINT8)((B&LT; 128)(2 *((A&GT;&GT; 1)+64))*((浮点) B / 255):( 255-(2 *(255  - ((A&GT;→1)+64))*(浮点)(255-B)/ 255))))

以上您的code计算混合的一个像素。

A,B 是2个不同的像素, aampleNearest 函数从输入图像得到2个像素。

DST,SRC 是2输入图像。

I'm a developing soft-light algorithm from scratch for Android base on the docs from Adobe: http://www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pdf_reference_archives/blend_modes.pdf http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/SoftLight.pbk

Can anyone explain for me the algorithm or at least dst, src, cb, cs, sampleNearest() function and how to calculate them? Thanks you!

input image4 dst;
input image4 src;
output pixel4 result;

void
evaluatePixel()
{
    pixel4 a = sampleNearest(dst,outCoord()); // cb
    pixel4 b = sampleNearest(src,outCoord()); // cs
    ....
}

解决方案

See this answer for the blending formula:

     ChannelBlend_SoftLight(A,B)  ((uint8)((B < 128)?(2*((A>>1)+64))*((float)B/255):(255-(2*(255-((A>>1)+64))*(float)(255-B)/255))))

Your code above calculates the blending for one pixel.

a, b are the 2 different pixels, the aampleNearest function gets the 2 pixels from the input images.

dst,src are the 2 input images.

这篇关于图像处理:软光算法,如Photoshop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆