updated rgb2luma script function to work with rgba colours.