5.5. fontblend

The register function

fontblend.blendfunction(fun)[source]

Registers a class as a blend function

Parameters:fun – A function that takes two numpy images, blends them and then returns the resulting image.

Example:

@blendfunction
def my_blend_function(base, blend):
    return base + blend

The rest of the functions

Copyright @ 2013 Mathias Westerdahl

fontblend.blendcolorburn(base, blend)[source]

R = 1 - (1 - base) / blend

Parameters:
  • base – The base image
  • blend – The blend image
fontblend.blendcolordodge(base, blend)[source]

R = base / (1 - blend)

Parameters:
  • base – The base image
  • blend – The blend image
fontblend.blenddarken(base, blend)[source]

R = min( base, blend )

Parameters:
  • base – The base image
  • blend – The blend image
fontblend.blendlighten(base, blend)[source]

R = max( base, blend )

Parameters:
  • base – The base image
  • blend – The blend image
fontblend.blendlinearburn(base, blend)[source]

R = base + blend - 1

Parameters:
  • base – The base image
  • blend – The blend image
fontblend.blendlineardodge(base, blend)[source]

R = base + blend

Parameters:
  • base – The base image
  • blend – The blend image
fontblend.blendmultiply(base, blend)[source]

R = base * blend

Parameters:
  • base – The base image
  • blend – The blend image
fontblend.blendnormal(base, blend)[source]

R = blend

Parameters:
  • base – The base image
  • blend – The blend image
fontblend.blendscreen(base, blend)[source]

R = 1 - (1 - base) * (1 - blend)

Parameters:
  • base – The base image
  • blend – The blend image