Shrink and move image to an absolute position

I know that I can shrink and move a div but am having problems shrinking an image and keeping the proportions correct. Can anyone help with advice or a website link?

It’s fairly straight forward.

Load the image into an Image object and then you can get the image’s actual dimensions in pixels using the object’s width and height properties. Then calculate the image’s aspect ratio (width/height), Set the new height or width in pixels and then calculate the other dimension using the aspect ratio. This way you can set the image dimensions to whatever you like and still maintain the image’s aspect ratio.