[][src]Function photon_rs::multiple::blend

pub fn blend(
    photon_image: &mut PhotonImage,
    photon_image2: &PhotonImage,
    blend_mode: &str
)

Blend two images together. The blend_mode (3rd param) determines which blending mode to use; change this for varying effects. The blend modes available include: overlay, over, atop, xor, multiply, burn, soft_light, hard_light difference, lighten, darken, dodge, plus, exclusion (more to come) NOTE: The first image must be smaller than the second image passed as params. If the first image were larger than the second, then there would be overflowing pixels which would have no corresponding pixels in the second image.

Arguments

  • img - A DynamicImage that contains a view into the image.
  • img2 - The 2nd DynamicImage to be blended with the first.
  • blend_mode - The blending mode to use. See above for complete list of blend modes available.

Example

// For example, to add a watermark to an image at x: 30, y: 40:
use photon::multiple;
photon::multiple::watermark(img, watermark, 30, 40);