Calculating the difference between images

This BlendMode highlights the difference between two nodes (usually images):

You need to use one image as an input and another as an effect's target:

// chapter8/combining/BlendDiffDemo.javapublic void start(Stage primaryStage) {    Image image = new Image(        "https://github.com/sgrinev/mastering-javafx-9-book/blob/master/resources/sample.jpg?raw=true",         200, 200, true, true);    ImageInput ii = new ImageInput(image, 0, 0);    Image image2 = new Image(        "https://github.com/sgrinev/mastering-javafx-9-book/blob/master/resources/sample2.jpg?raw=true",         200, 200, true, true);    Blend blend = new Blend();    blend.setMode(BlendMode.DIFFERENCE); ...

Get Mastering JavaFX 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.