@Override
        public void apply(ImageView view, Study study) {
            for(Image i : study.getImages()) {
                BufferedImage origImg = i.getImageData();
                BufferedImage img = new BufferedImage(origImg.getColorModel(), origImg.copyData(null), origImg.isAlphaPremultiplied(), null);
                for(int x=0; x<img.getWidth(); x++)
                    for(int y=0; y<img.getHeight(); y++) {
                        int color = origImg.getRGB(x, y);
                        int newColor = scale(color & 0xff) |
                                (scale((color >> 8) & 0xff) << 8) |
                                (scale((color >> 16) & 0xff) << 16) |
                                ((color << 24) & 0xff);
                        img.setRGB(x, y, newColor);
                    }
                i.pushModifiedImage(img);
            }
            view.updateImageUI();
        }