Resizing images can be a chore, and even in the 2020's we still need to make smaller image files for use on websites. This post presents some options for either programmatically resizing images, or else using online resizing tools.
___________________________________________
Resizing programmatically
Command line [ImageMagick]
magick mogrify -resize 1600 *.jpg
___________________________________________
C# image resizing [stackoverflow]
___________________________________________
Python via the PILLOW library (replaces PIL)
python3 -m pip install Pillow
from PIL import Image
basewidth = 600
img = Image.open('fullsized_image.jpg')
wpercent = (basewidth / float(img.size[0]))
hsize = int((float(img.size[1]) * float(wpercent)))
img = img.resize((basewidth, hsize), Image.ANTIALIAS)
img.save('resized_image.jpg')
___________________________________________
JavaScript (TypeScript) on Node.js - Use the sharp npm package.
___________________________________________
Resizing via online tools
If you are not too worried about the IP or privacy of your images, then there are some free online tools that provide an image resizing service.zamzar.com is a file conversion service, but can also be used to reduce large images to a more reasonable size.
websiteplanet.com has an online image compressor tool. This tools allows you to compress both jpeg and png files and each picture can be up to 50 MB in size.
Comments
Post a Comment