Instead of hard-coding the RGB values, they can be opened up directly from the file: see Java Images.