pike.hubbe.net

[Top]
Image.Layer modes
previouswerror() Errornext

Appendix Image.Layer modes

All channels are calculated separately, if nothing else is specified.
top layer
bottom layer
normalD=L applied with alpha: D=(L*aL+S*(1-aL)*aS) / (aL+(1-aL)*aS), aD=(aL+(1-aL)*aS)
addD=L+S applied with alpha, aD=aS
subtractD=S-L applied with alpha, aD=aS
multiplyD=S*L applied with alpha, aD=aS
divideD=S/L applied with alpha, aD=aS
negdivideD=1.0-S/L applied with alpha, aD=aS
moduloD=S%L applied with alpha, aD=aS
invsubtractD=L-S applied with alpha, aD=aS
invdivideD=L/S applied with alpha, aD=aS
invmoduloD=L%S applied with alpha, aD=aS
imultiplyD=(1-L)*S applied with alpha, aD=aS
idivideD=S/(1-L) applied with alpha, aD=aS
invidivideD=L/(1-S) applied with alpha, aD=aS
differenceD=abs(L-S) applied with alpha, aD=aS
maxD=max(L,S) applied with alpha, aD=aS
minD=min(L,S) applied with alpha, aD=aS
bitwise_andD=L&S applied with alpha, aD=aS
bitwise_orD=L|S applied with alpha, aD=aS
bitwise_xorD=L^S applied with alpha, aD=aS
replaceD=(L*aL+S*(1-aL)*aS) / (aL+(1-aL)*aS), aD=aS
redDr=(Lr*aLr+Sr*(1-aLr)*aSr) / (aLr+(1-aLr)*aSr), Dgb=Sgb, aD=aS
greenDg=(Lg*aLg+Sg*(1-aLg)*aSg) / (aLg+(1-aLg)*aSg), Drb=Srb, aD=aS
blueDb=(Lb*aLb+Sb*(1-aLb)*aSb) / (aLb+(1-aLb)*aSb), Drg=Srg, aD=aS
hardlightLike photoshop hardlight layer mode, aD=aS
replace_hsvDhsv=Lhsv apply with alpha, aD=aS
hueDh=Lh apply with alpha, Dsv=Lsv, aD=aS
saturationDs=Ls apply with alpha, Dhv=Lhv, aD=aS
valueDv=Lv apply with alpha, Dhs=Lhs, aD=aS
colorDhs=Lhs apply with alpha, Dv=Lv, aD=aS
value_mulDv=Lv*Sv apply with alpha, Dhs=Lhs, aD=aS
darkenDv=min(Lv,Sv) apply with alpha, Dhs=Lhs, aD=aS
lightenDv=max(Lv,Sv) apply with alpha, Dhs=Lhs, aD=aS
saturateDs=max(Ls,Ss) apply with alpha, Dhv=Lhv, aD=aS
desaturateDs=min(Ls,Ss) apply with alpha, Dhv=Lhv, aD=aS
hls_replaceDhls=Lhls apply with alpha, aD=aS
hls_hueDh=Lh apply with alpha, Dsv=Lsv, aD=aS
hls_saturationDs=Ls apply with alpha, Dhv=Lhv, aD=aS
hls_lightnessDl=Ll apply with alpha, Dhs=Lhs, aD=aS
hls_colorDhs=Lhs apply with alpha, Dl=Ll, aD=aS
hls_lightness_mulDl=Ll*Sl apply with alpha, Dhs=Lhs, aD=aS
hls_darkenDl=min(Ll,Sl) apply with alpha, Dhs=Lhs, aD=aS
hls_lightenDl=max(Ll,Sl) apply with alpha, Dhs=Lhs, aD=aS
hls_saturateDs=max(Ls,Ss) apply with alpha, Dhl=Lhl, aD=aS
hls_desaturateDs=min(Ls,Ss) apply with alpha, Dhl=Lhl, aD=aS
dissolvei=random 0 or 1, D=i?L:S, aD=i+aS
behindD=(S*aS+L*(1-aS)*aL) / (aS+(1-aS)*aL), aD=(aS+(1-aS)*aL); simply swap S and L
eraseD=S, aD=aS*(1-aL)
screen1-(1-S)*(1-L) applied with alpha, aD=aS
overlay(1-(1-a)*(1-b)-a*b)*a+a*b applied with alpha, aD=aS
burn_alphaaD=aL+aS applied with alpha, D=L+S; experimental, may change or be removed
equaleach channel D=max if L==S, 0 otherwise, apply with alpha
not_equaleach channel D=max if L!=S, 0 otherwise, apply with alpha
lesseach channel D=max if L<S, 0 otherwise, apply with alpha
moreeach channel D=max if L>S, 0 otherwise, apply with alpha
less_or_equaleach channel D=max if L<=S, 0 otherwise, apply with alpha
more_or_equaleach channel D=max if L>=S, 0 otherwise, apply with alpha
logic_equallogic: D=white and opaque if L==S, black and transparent otherwise
logic_not_equallogic: D=white and opaque if any L!=S, black and transparent otherwise
logic_strict_lesslogic: D=white and opaque if all L<S, black and transparent otherwise
logic_strict_morelogic: D=white and opaque if all L>S, black and transparent otherwise
logic_strict_less_equallogic: D=white and opaque if all L<=L, black and transparent otherwise
logic_strict_more_equallogic: D=white and opaque if all L>=L, black and transparent otherwise


Extracted from Pike v7.3 release 11 at 2001-11-03.