diff --git a/reference/image/pimage/blend_burn.py b/reference/image/pimage/blend_burn.py new file mode 100644 index 0000000..4360040 --- /dev/null +++ b/reference/image/pimage/blend_burn.py @@ -0,0 +1,22 @@ +""" +Color Burn increases the contrast between target and blend colors,resulting in more highly saturated mid-tones and reduced highlights. +""" +from p5 import * + +img1 = load_image('../src/luminale-512.jpg') +img2 = load_image('../src/grand-theatre-512.jpg') +img3 = load_image('../src/luminale-512.jpg') + +img3.blend(img2, 'burn') + +def setup(): + size(img1.width, int(img1.height * 1.5)) + no_loop() + +def draw(): + image(img1, (0, 0), (img1.width // 2, img1.height // 2)) + image(img2, (img1.width // 2, 0), (img1.width // 2, img1.height // 2)) + image(img3, (0, img1.height // 2)) + +if __name__ == '__main__': + run() diff --git a/reference/image/pimage/blend_difference.py b/reference/image/pimage/blend_difference.py new file mode 100644 index 0000000..04c61cb --- /dev/null +++ b/reference/image/pimage/blend_difference.py @@ -0,0 +1,22 @@ +""" +The Difference blending mode uses the difference of the target and blend pixels as the resulting blend. +""" +from p5 import * + +img1 = load_image('../src/luminale-512.jpg') +img2 = load_image('../src/grand-theatre-512.jpg') +img3 = load_image('../src/luminale-512.jpg') + +img3.blend(img2, 'difference') + +def setup(): + size(img1.width, int(img1.height * 1.5)) + no_loop() + +def draw(): + image(img1, (0, 0), (img1.width // 2, img1.height // 2)) + image(img2, (img1.width // 2, 0), (img1.width // 2, img1.height // 2)) + image(img3, (0, img1.height // 2)) + +if __name__ == '__main__': + run() diff --git a/reference/image/pimage/blend_dodge.py b/reference/image/pimage/blend_dodge.py new file mode 100644 index 0000000..6507b73 --- /dev/null +++ b/reference/image/pimage/blend_dodge.py @@ -0,0 +1,23 @@ +""" +Color Dodge gives you a brigher effect by decreasing the contarast between the +target and the blend colors resulting in saturated mid tones and blown highlights. +""" +from p5 import * + +img1 = load_image('../src/luminale-512.jpg') +img2 = load_image('../src/grand-theatre-512.jpg') +img3 = load_image('../src/luminale-512.jpg') + +img3.blend(img2, 'dodge') + +def setup(): + size(img1.width, int(img1.height * 1.5)) + no_loop() + +def draw(): + image(img1, (0, 0), (img1.width // 2, img1.height // 2)) + image(img2, (img1.width // 2, 0), (img1.width // 2, img1.height // 2)) + image(img3, (0, img1.height // 2)) + +if __name__ == '__main__': + run() diff --git a/reference/image/pimage/blend_exclusion.py b/reference/image/pimage/blend_exclusion.py new file mode 100644 index 0000000..82d533e --- /dev/null +++ b/reference/image/pimage/blend_exclusion.py @@ -0,0 +1,24 @@ +""" +Exclusion is very similar to Difference. +Blending with white inverts the base color values, while blending with black produces no change. +However, Blending with 50% gray produces 50% gray. +""" +from p5 import * + +img1 = load_image('../src/luminale-512.jpg') +img2 = load_image('../src/grand-theatre-512.jpg') +img3 = load_image('../src/luminale-512.jpg') + +img3.blend(img2, 'exclusion') + +def setup(): + size(img1.width, int(img1.height * 1.5)) + no_loop() + +def draw(): + image(img1, (0, 0), (img1.width // 2, img1.height // 2)) + image(img2, (img1.width // 2, 0), (img1.width // 2, img1.height // 2)) + image(img3, (0, img1.height // 2)) + +if __name__ == '__main__': + run() diff --git a/reference/image/pimage/blend_hard_light.py b/reference/image/pimage/blend_hard_light.py new file mode 100644 index 0000000..886e0ba --- /dev/null +++ b/reference/image/pimage/blend_hard_light.py @@ -0,0 +1,23 @@ +""" +This mode combines the multiply and screen blending modes using the +brightness values of the blend layerto make its calculation. +""" +from p5 import * + +img1 = load_image('../src/luminale-512.jpg') +img2 = load_image('../src/grand-theatre-512.jpg') +img3 = load_image('../src/luminale-512.jpg') + +img3.blend(img2, 'hard_light') + +def setup(): + size(img1.width, int(img1.height * 1.5)) + no_loop() + +def draw(): + image(img1, (0, 0), (img1.width // 2, img1.height // 2)) + image(img2, (img1.width // 2, 0), (img1.width // 2, img1.height // 2)) + image(img3, (0, img1.height // 2)) + +if __name__ == '__main__': + run() diff --git a/reference/image/pimage/blend_overlay.py b/reference/image/pimage/blend_overlay.py new file mode 100644 index 0000000..116f191 --- /dev/null +++ b/reference/image/pimage/blend_overlay.py @@ -0,0 +1,23 @@ +""" +Overlay is combination of multiply and screen with the target layer always shining though. +Its calculation is based on the target layer instead of blend layer. +""" +from p5 import * + +img1 = load_image('../src/luminale-512.jpg') +img2 = load_image('../src/grand-theatre-512.jpg') +img3 = load_image('../src/luminale-512.jpg') + +img3.blend(img2, 'overlay') + +def setup(): + size(img1.width, int(img1.height * 1.5)) + no_loop() + +def draw(): + image(img1, (0, 0), (img1.width // 2, img1.height // 2)) + image(img2, (img1.width // 2, 0), (img1.width // 2, img1.height // 2)) + image(img3, (0, img1.height // 2)) + +if __name__ == '__main__': + run() diff --git a/reference/image/pimage/blend_soft_light.py b/reference/image/pimage/blend_soft_light.py new file mode 100644 index 0000000..a65c7f4 --- /dev/null +++ b/reference/image/pimage/blend_soft_light.py @@ -0,0 +1,23 @@ +""" +Soft Light is very much like Overlay. +It applies either a darkening or lightening effect depending on the luminance values, but in a much more subtle way. +""" +from p5 import * + +img1 = load_image('../src/luminale-512.jpg') +img2 = load_image('../src/grand-theatre-512.jpg') +img3 = load_image('../src/luminale-512.jpg') + +img3.blend(img2, 'soft_light') + +def setup(): + size(img1.width, int(img1.height * 1.5)) + no_loop() + +def draw(): + image(img1, (0, 0), (img1.width // 2, img1.height // 2)) + image(img2, (img1.width // 2, 0), (img1.width // 2, img1.height // 2)) + image(img3, (0, img1.height // 2)) + +if __name__ == '__main__': + run()