Skip to main content

Module general

Module general 

Source
Expand description

General pipe: soft mask, non-normal blend modes, non-isolated/knockout groups.

This is the “everything else” path, matching Splash::pipeRun (the general case, not one of the specialised pipeRunSimple* or pipeRunAA* variants).

§Compositing formula (PDF spec §11.3)

Given source alpha a_src, destination alpha a_dst, and source/dest colours:

a_result = a_src + a_dst - div255(a_src * a_dst)           (isolated, non-knockout)
c_result = ((a_result - a_src) * c_dst + a_src * blend(c_src, c_dst)) / a_result

For blend mode Normal, blend(c_src, c_dst) = c_src so the formula reduces to the standard Porter-Duff over.