Changing rasterWidth function to use max color per channel