Skip to content

Commit a4b791f

Browse files
committed
Closes #11 (Brightness)
Closes #12 (Glitch)
1 parent 1304261 commit a4b791f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1311
-119
lines changed

examples/Basics/Basics.pde

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import milchreis.imageprocessing.*;
99

10-
int numberOfAlgorithms = 10;
10+
int numberOfAlgorithms = 11;
1111
int currentAlgorithm = 0;
1212

1313
PImage image;
@@ -54,35 +54,41 @@ void draw() {
5454
processedImage = Erosion.apply(processedImage, (int) map(mouseX, 0, width, 1, 10));
5555
}
5656

57-
// AutoBalance for simple color correction
57+
// Brightness correction
5858
if(currentAlgorithm == 4) {
59+
int intensity = (int) map(mouseX, 0, width, -255, 255);
60+
processedImage = Brightness.apply(image, intensity);
61+
}
62+
63+
// AutoBalance for simple color correction
64+
if(currentAlgorithm == 5) {
5965
processedImage = AutoBalance.apply(image);
6066
}
6167

6268
// Pixelation
63-
if(currentAlgorithm == 5) {
69+
if(currentAlgorithm == 6) {
6470
int pixelsize = (int) map(mouseX, 0, width, 0, 100);
6571
processedImage = Pixelation.apply(image, pixelsize);
6672
}
6773

6874
// Gaussian for blurred images
69-
if(currentAlgorithm == 6) {
75+
if(currentAlgorithm == 7) {
7076
processedImage = Gaussian.apply(image, 7, 0.84089642);
7177
}
7278

7379
// Edge detection with Canny's algorithm
74-
if(currentAlgorithm == 7) {
80+
if(currentAlgorithm == 8) {
7581
processedImage = CannyEdgeDetector.apply(image);
7682
}
7783

7884
// Edge detection with Sobel's algorithm
79-
if(currentAlgorithm == 8) {
85+
if(currentAlgorithm == 9) {
8086
// SobelEdgeDetector.apply(image, false) creates a colored image
8187
processedImage = SobelEdgeDetector.apply(image);
8288
}
8389

8490
// Quantize the colors
85-
if(currentAlgorithm == 9) {
91+
if(currentAlgorithm == 10) {
8692
int quant = (int) map(mouseX, 0, width, 1, 10);
8793
processedImage = Quantization.apply(image, quant);
8894
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* Example for an artificial glitch effect.
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+
* Author: Nick 'Milchreis' Müller
6+
*/
7+
8+
import milchreis.imageprocessing.*;
9+
10+
PImage image;
11+
12+
void setup() {
13+
size(550, 550);
14+
// Load image
15+
image = loadImage(dataPath("example.jpg"));
16+
}
17+
18+
void draw() {
19+
20+
if(mousePressed == true) {
21+
image(image, 0, 0);
22+
} else {
23+
int intensity = (int) map(mouseX, 0, width, 0, 4);
24+
image(Glitch.apply(image, intensity), 0, 0);
25+
26+
// You can also use:
27+
// Glitch.apply(image)
28+
// Glitch.apply(image, intensity, scanlineHeight)
29+
}
30+
}
378 KB
Loading

img/brightness.png

562 KB
Loading

img/glitch.png

605 KB
Loading

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ paragraph = Easy access for bluring or coloring images or video streams.
4141
# compare different versions of the same Library, and check if an update is
4242
# available. You should think of it as a counter, counting the total number of
4343
# releases you've had.
44-
version = 3 # This must be parsable as an int
44+
version = 4 # This must be parsable as an int
4545

4646
# The version as the user will see it. If blank, the version attribute will be
4747
# used here. This should be a single word, with no spaces.
48-
prettyVersion = 1.1.0 # This is treated as a String
48+
prettyVersion = 1.3.0 # This is treated as a String
4949

5050
# The min and max revision of Processing compatible with your Library.
5151
# Note that these fields use the revision and not the version of Processing,

library/ImageProcessing.jar

2.66 KB
Binary file not shown.

reference/allclasses-frame.html

Lines changed: 5 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_151) on Wed Jan 31 22:42:40 CET 2018 -->
5+
<!-- Generated by javadoc (1.8.0_151) on Sat Feb 03 23:11:46 CET 2018 -->
66
<title>All Classes (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-01-31">
7+
<meta name="date" content="2018-02-03">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>
@@ -14,14 +14,17 @@ <h1 class="bar">All&nbsp;Classes</h1>
1414
<ul>
1515
<li><a href="milchreis/imageprocessing/AutoBalance.html" title="class in milchreis.imageprocessing" target="classFrame">AutoBalance</a></li>
1616
<li><a href="milchreis/imageprocessing/Bloom.html" title="class in milchreis.imageprocessing" target="classFrame">Bloom</a></li>
17+
<li><a href="milchreis/imageprocessing/Brightness.html" title="class in milchreis.imageprocessing" target="classFrame">Brightness</a></li>
1718
<li><a href="milchreis/imageprocessing/CannyEdgeDetector.html" title="class in milchreis.imageprocessing" target="classFrame">CannyEdgeDetector</a></li>
1819
<li><a href="milchreis/imageprocessing/ColorShift.html" title="class in milchreis.imageprocessing" target="classFrame">ColorShift</a></li>
1920
<li><a href="milchreis/imageprocessing/Convolution.html" title="class in milchreis.imageprocessing" target="classFrame">Convolution</a></li>
21+
<li><a href="milchreis/imageprocessing/Denoise.html" title="class in milchreis.imageprocessing" target="classFrame">Denoise</a></li>
2022
<li><a href="milchreis/imageprocessing/Dilation.html" title="class in milchreis.imageprocessing" target="classFrame">Dilation</a></li>
2123
<li><a href="milchreis/imageprocessing/Dithering.html" title="class in milchreis.imageprocessing" target="classFrame">Dithering</a></li>
2224
<li><a href="milchreis/imageprocessing/Dithering.Algorithm.html" title="enum in milchreis.imageprocessing" target="classFrame">Dithering.Algorithm</a></li>
2325
<li><a href="milchreis/imageprocessing/Erosion.html" title="class in milchreis.imageprocessing" target="classFrame">Erosion</a></li>
2426
<li><a href="milchreis/imageprocessing/Gaussian.html" title="class in milchreis.imageprocessing" target="classFrame">Gaussian</a></li>
27+
<li><a href="milchreis/imageprocessing/Glitch.html" title="class in milchreis.imageprocessing" target="classFrame">Glitch</a></li>
2528
<li><a href="milchreis/imageprocessing/Grayscale.html" title="class in milchreis.imageprocessing" target="classFrame">Grayscale</a></li>
2629
<li><a href="milchreis/imageprocessing/Halftone.html" title="class in milchreis.imageprocessing" target="classFrame">Halftone</a></li>
2730
<li><a href="milchreis/imageprocessing/Histogram.html" title="class in milchreis.imageprocessing" target="classFrame">Histogram</a></li>

reference/allclasses-noframe.html

Lines changed: 5 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_151) on Wed Jan 31 22:42:40 CET 2018 -->
5+
<!-- Generated by javadoc (1.8.0_151) on Sat Feb 03 23:11:46 CET 2018 -->
66
<title>All Classes (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-01-31">
7+
<meta name="date" content="2018-02-03">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>
@@ -14,14 +14,17 @@ <h1 class="bar">All&nbsp;Classes</h1>
1414
<ul>
1515
<li><a href="milchreis/imageprocessing/AutoBalance.html" title="class in milchreis.imageprocessing">AutoBalance</a></li>
1616
<li><a href="milchreis/imageprocessing/Bloom.html" title="class in milchreis.imageprocessing">Bloom</a></li>
17+
<li><a href="milchreis/imageprocessing/Brightness.html" title="class in milchreis.imageprocessing">Brightness</a></li>
1718
<li><a href="milchreis/imageprocessing/CannyEdgeDetector.html" title="class in milchreis.imageprocessing">CannyEdgeDetector</a></li>
1819
<li><a href="milchreis/imageprocessing/ColorShift.html" title="class in milchreis.imageprocessing">ColorShift</a></li>
1920
<li><a href="milchreis/imageprocessing/Convolution.html" title="class in milchreis.imageprocessing">Convolution</a></li>
21+
<li><a href="milchreis/imageprocessing/Denoise.html" title="class in milchreis.imageprocessing">Denoise</a></li>
2022
<li><a href="milchreis/imageprocessing/Dilation.html" title="class in milchreis.imageprocessing">Dilation</a></li>
2123
<li><a href="milchreis/imageprocessing/Dithering.html" title="class in milchreis.imageprocessing">Dithering</a></li>
2224
<li><a href="milchreis/imageprocessing/Dithering.Algorithm.html" title="enum in milchreis.imageprocessing">Dithering.Algorithm</a></li>
2325
<li><a href="milchreis/imageprocessing/Erosion.html" title="class in milchreis.imageprocessing">Erosion</a></li>
2426
<li><a href="milchreis/imageprocessing/Gaussian.html" title="class in milchreis.imageprocessing">Gaussian</a></li>
27+
<li><a href="milchreis/imageprocessing/Glitch.html" title="class in milchreis.imageprocessing">Glitch</a></li>
2528
<li><a href="milchreis/imageprocessing/Grayscale.html" title="class in milchreis.imageprocessing">Grayscale</a></li>
2629
<li><a href="milchreis/imageprocessing/Halftone.html" title="class in milchreis.imageprocessing">Halftone</a></li>
2730
<li><a href="milchreis/imageprocessing/Histogram.html" title="class in milchreis.imageprocessing">Histogram</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_151) on Wed Jan 31 22:42:39 CET 2018 -->
5+
<!-- Generated by javadoc (1.8.0_151) on Sat Feb 03 23:11:46 CET 2018 -->
66
<title>Constant Field Values (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-01-31">
7+
<meta name="date" content="2018-02-03">
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)