How do i keep the ratio of an image when unwrapping
You can view and change the dimensions of the cylinder in the panel to the right of the 3D viewport, labeled "Transform". You can then calculate a proper diameter and height for the cylinder, using the image dimensions.

In the Dimensions section, set X and Y to the desired diameter of the cylinder, then set Z to the desired height. Press ctrl + A to apply the scale, then scale to whatever size you want.

Lastly, keep in mind that for graphics, if it looks right it's good enough, so you can probably eyeball it and no one will notice.