Implement read from/write to file with R G B array separately.