How do you resize an img

How do you resize an img
0

#1

I have an image that im trying to post but its too large how do i make it smaller


#2

You can use tools like Gimp, Paint, Photoshop or other editing tools.

And thare are also webservices and softwares dedicated to image resizing:

I filtered the alternatives by opensource licenses, but there may be commercial demos as well.


#3

I just wasn’t thinking clearly you can use the height and width attribute to resize an img


#4

Ho :slight_smile:
No problem !


#5

Know exactly what you’re getting… Resize display dimensions - yes. But the original file size remains.

If the image is 2MB, 1920x2048 size… doing this

<img src="bigphoto.jpg" width="300" height="200"> 

will still download to the user a 2MB file, albeit displayed as a small 300x200 image.


#6

Don’t forget about https://www.getpaint.net/ which is great for the basics.

You can use CSS to resize too but it won’t change the actual file size as @owel said.


#7

simply with css :
.myImg {
max-width:100%; /* or less */
height: auto;
}


#8

For image optimization, I use a web app called Pixler. I also used it to make the icons for the social media links on my portfolio site.


#9

also worth noting you can compress file size without losing image quality using https://tinypng.com/