changed integer pixel handling to float to suit android standards