Canvas canvas = new Canvas(image.getWidth(), image.getHeight());
GraphicsContext gc = canvas.getGraphicsContext2D();
gc.drawImage(image, 0, 0);
gc.applyEffect(colorAdjust);
WritableImage colouredImage = new WritableImage((int) image.getWidth(), (int) image.getHeight());
canvas.snapshot(new SnapshotParameters(), colouredImage);
coverImageView.setImage(colouredImage);
// Convert to a PNG and store in the project model.
ImageIO.setUseCache(false);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(SwingFXUtils.fromFXImage(colouredImage, null), "png", baos);