created the width and height on pixelpainter function