added transparency option to resizing function