Skip to content

Commit f3b2531

Browse files
committed
Adds shadows and lights
1 parent 196917a commit f3b2531

63 files changed

Lines changed: 909 additions & 122 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* Example for changing the light parts of an image.
2+
* Move the mouse from left to right to see different intensity
3+
* or press the left mouse button to see the original image.
4+
*
5+
* In the middle position the image is unchanged. Move the mouse
6+
* in the left area of the image the light parts will be
7+
* more dark and the right area you will lift up the lights.
8+
*
9+
* You want more? See the Shadows.apply() for doing the same in the shadows.
10+
*
11+
* Author: Nick 'Milchreis' Müller
12+
*/
13+
14+
import milchreis.imageprocessing.*;
15+
16+
PImage image;
17+
18+
void setup() {
19+
size(550, 550);
20+
// Load image
21+
image = loadImage(dataPath("example.jpg"));
22+
}
23+
24+
void draw() {
25+
26+
if(mousePressed == true) {
27+
image(image, 0, 0);
28+
} else {
29+
float intensity = map(mouseX, 0, width, -0.3f, 0.3f);
30+
image(Lights.apply(image, intensity), 0, 0);
31+
}
32+
}
378 KB
Loading
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* Example for changing the dark parts of an image.
2+
* Move the mouse from left to right to see different intensity
3+
* or press the left mouse button to see the original image.
4+
*
5+
* In the middle position the image is unchanged. Move the mouse
6+
* in the left area of the image the dark parts will be
7+
* more dark and the right area you will lift up the shadows.
8+
*
9+
* You want more? See the Lights.apply() for doing the same in the highlights.
10+
*
11+
* Author: Nick 'Milchreis' Müller
12+
*/
13+
14+
import milchreis.imageprocessing.*;
15+
16+
PImage image;
17+
18+
void setup() {
19+
size(550, 550);
20+
// Load image
21+
image = loadImage(dataPath("example.jpg"));
22+
}
23+
24+
void draw() {
25+
26+
if(mousePressed == true) {
27+
image(image, 0, 0);
28+
} else {
29+
float intensity = map(mouseX, 0, width, -0.3f, 0.3f);
30+
image(Shadows.apply(image, intensity), 0, 0);
31+
}
32+
}
378 KB
Loading

img/lights.png

607 KB
Loading

img/shadows.png

630 KB
Loading

library/ImageProcessing.jar

1.38 KB
Binary file not shown.

reference/allclasses-frame.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="de">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_161) on Thu Apr 12 22:53:25 CEST 2018 -->
5+
<!-- Generated by javadoc (1.8.0_171) on Mon Apr 30 17:06:15 CEST 2018 -->
66
<title>All Classes (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-04-12">
7+
<meta name="date" content="2018-04-30">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>
@@ -34,11 +34,13 @@ <h1 class="bar">All&nbsp;Classes</h1>
3434
<li><a href="milchreis/imageprocessing/Intensity.html" title="class in milchreis.imageprocessing" target="classFrame">Intensity</a></li>
3535
<li><a href="milchreis/imageprocessing/utils/Interpolation.html" title="class in milchreis.imageprocessing.utils" target="classFrame">Interpolation</a></li>
3636
<li><a href="milchreis/imageprocessing/InvertColors.html" title="class in milchreis.imageprocessing" target="classFrame">InvertColors</a></li>
37+
<li><a href="milchreis/imageprocessing/Lights.html" title="class in milchreis.imageprocessing" target="classFrame">Lights</a></li>
3738
<li><a href="milchreis/imageprocessing/LUT.html" title="class in milchreis.imageprocessing" target="classFrame">LUT</a></li>
3839
<li><a href="milchreis/imageprocessing/LUT.STYLE.html" title="enum in milchreis.imageprocessing" target="classFrame">LUT.STYLE</a></li>
3940
<li><a href="milchreis/imageprocessing/Pixelation.html" title="class in milchreis.imageprocessing" target="classFrame">Pixelation</a></li>
4041
<li><a href="milchreis/imageprocessing/Quantization.html" title="class in milchreis.imageprocessing" target="classFrame">Quantization</a></li>
4142
<li><a href="milchreis/imageprocessing/Scanlines.html" title="class in milchreis.imageprocessing" target="classFrame">Scanlines</a></li>
43+
<li><a href="milchreis/imageprocessing/Shadows.html" title="class in milchreis.imageprocessing" target="classFrame">Shadows</a></li>
4244
<li><a href="milchreis/imageprocessing/Sharpen.html" title="class in milchreis.imageprocessing" target="classFrame">Sharpen</a></li>
4345
<li><a href="milchreis/imageprocessing/SobelEdgeDetector.html" title="class in milchreis.imageprocessing" target="classFrame">SobelEdgeDetector</a></li>
4446
<li><a href="milchreis/imageprocessing/Stacker.html" title="class in milchreis.imageprocessing" target="classFrame">Stacker</a></li>

reference/allclasses-noframe.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="de">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_161) on Thu Apr 12 22:53:25 CEST 2018 -->
5+
<!-- Generated by javadoc (1.8.0_171) on Mon Apr 30 17:06:15 CEST 2018 -->
66
<title>All Classes (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-04-12">
7+
<meta name="date" content="2018-04-30">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>
@@ -34,11 +34,13 @@ <h1 class="bar">All&nbsp;Classes</h1>
3434
<li><a href="milchreis/imageprocessing/Intensity.html" title="class in milchreis.imageprocessing">Intensity</a></li>
3535
<li><a href="milchreis/imageprocessing/utils/Interpolation.html" title="class in milchreis.imageprocessing.utils">Interpolation</a></li>
3636
<li><a href="milchreis/imageprocessing/InvertColors.html" title="class in milchreis.imageprocessing">InvertColors</a></li>
37+
<li><a href="milchreis/imageprocessing/Lights.html" title="class in milchreis.imageprocessing">Lights</a></li>
3738
<li><a href="milchreis/imageprocessing/LUT.html" title="class in milchreis.imageprocessing">LUT</a></li>
3839
<li><a href="milchreis/imageprocessing/LUT.STYLE.html" title="enum in milchreis.imageprocessing">LUT.STYLE</a></li>
3940
<li><a href="milchreis/imageprocessing/Pixelation.html" title="class in milchreis.imageprocessing">Pixelation</a></li>
4041
<li><a href="milchreis/imageprocessing/Quantization.html" title="class in milchreis.imageprocessing">Quantization</a></li>
4142
<li><a href="milchreis/imageprocessing/Scanlines.html" title="class in milchreis.imageprocessing">Scanlines</a></li>
43+
<li><a href="milchreis/imageprocessing/Shadows.html" title="class in milchreis.imageprocessing">Shadows</a></li>
4244
<li><a href="milchreis/imageprocessing/Sharpen.html" title="class in milchreis.imageprocessing">Sharpen</a></li>
4345
<li><a href="milchreis/imageprocessing/SobelEdgeDetector.html" title="class in milchreis.imageprocessing">SobelEdgeDetector</a></li>
4446
<li><a href="milchreis/imageprocessing/Stacker.html" title="class in milchreis.imageprocessing">Stacker</a></li>

reference/constant-values.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="de">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_161) on Thu Apr 12 22:53:25 CEST 2018 -->
5+
<!-- Generated by javadoc (1.8.0_171) on Mon Apr 30 17:06:14 CEST 2018 -->
66
<title>Constant Field Values (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-04-12">
7+
<meta name="date" content="2018-04-30">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>

0 commit comments

Comments
 (0)