$p3_max = $width >= $height ? $width : $height;
$p5 = int($width / 2);
$p5_max = $width;
$p6 = int ($height / 2);
$p6_max = $height;
