Added a function for calculating pixel widths into percents.