This commit is contained in:
2023-12-04 15:49:12 +01:00
parent 16e6e51472
commit 9454948799
2 changed files with 12 additions and 7 deletions

View File

@@ -7,8 +7,11 @@ object ImageProcessingApp extends App {
val imageFile = "./res/collins_eileen.png"
val org = new ImageGraphics(imageFile, "Original", -500, -250)
val dest = new ImageGraphics(imageFile, "Duplicate", 0, -250)
val thresh = new ImageGraphics(imageFile, "Threshold", -500, 250)
// Simple copy and display
val newPixels = ImageFilters.duplicate(org.getPixelsBW())
dest.setPixelsBW(newPixels)
thresh.setPixelsBW(ImageFilters.threshold(newPixels, 128))
}