-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Delete FilterDifferenceTest.java"
This reverts commit eebfd3f.
- Loading branch information
1 parent
6e4f4eb
commit 495f013
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/test/java/com/marginallyclever/makelangelo/makeart/imagefilter/FilterDifferenceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.marginallyclever.makelangelo.makeart.imagefilter; | ||
|
||
import com.marginallyclever.makelangelo.makeart.TransformedImage; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import javax.imageio.ImageIO; | ||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
|
||
public class FilterDifferenceTest { | ||
@Test | ||
public void test() throws IOException { | ||
TransformedImage src = new TransformedImage( ImageIO.read(new FileInputStream("src/test/resources/chicken.png")) ); | ||
Filter_GaussianBlur a = new Filter_GaussianBlur(src,2); | ||
TransformedImage a2 = a.filter(); | ||
ImageIO.write(a2.getSourceImage(), "jpg", new java.io.File("src/test/resources/chicken-a.jpg")); | ||
|
||
Filter_GaussianBlur b = new Filter_GaussianBlur(src,4); | ||
TransformedImage b2 = b.filter(); | ||
ImageIO.write(b2.getSourceImage(), "jpg", new java.io.File("src/test/resources/chicken-b.jpg")); | ||
|
||
Filter_Scale scale = new Filter_Scale(b2,0.85); | ||
TransformedImage afterScale = scale.filter(); | ||
ImageIO.write(afterScale.getSourceImage(), "jpg", new java.io.File("src/test/resources/chicken-c.jpg")); | ||
|
||
Filter_Difference diff = new Filter_Difference(a2,afterScale); | ||
TransformedImage afterDiff = diff.filter(); | ||
ImageIO.write(afterDiff.getSourceImage(), "jpg", new java.io.File("src/test/resources/chicken-d.jpg")); | ||
|
||
Filter_Threshold threshold = new Filter_Threshold(afterDiff,8); | ||
TransformedImage afterThreshold = threshold.filter(); | ||
|
||
ImageIO.write(afterThreshold.getSourceImage(), "jpg", new java.io.File("src/test/resources/chicken-difference.jpg")); | ||
} | ||
|
||
} |