Currently, I'm exploring the most efficient ways to optimize image loading speed on a webpage. Specifically, I am looking for advice on the best method for resizing an image from 1600x900 to 890x500.
Method 1
Utilize the following code:
<img src="myPic.png" height="500" width="890"/>
Method 2
If you prefer, resize the image using Photoshop or a similar tool and use: <img src="myPic.png"/>
Method 3
You can also resize the image in Photoshop and then insert it with this code:
<img src="myPic.png" height="500" width="890"/>
Method 4
Consider utilizing CSS to manipulate the image size, possibly incorporating elements of the aforementioned methods.
Choosing the Optimal Picture Format
I am conflicted about selecting the best picture format. While GIFs can reduce file size, they often compromise quality. PNGs are known for their high quality but come with larger file sizes. On the other hand, I have avoided JPGs due to their relatively large file sizes and limited background capabilities.
I welcome any insights or recommendations on this topic! Thank you!