Table of Contents
This simple image converter converts .jpg/.jpeg and .png images locally on your PC to .webp images, which can then be used on websites. It also does the following:
- It fixes the orientation of the image
- It resized the image so that the bigger dimension is 1920px if the image is bigger than that
You can also adjust the following:
- Adjust the image quality (Default is 75%)
- Crop the images to squares and decide if left/top, middle, or right/bottom is kept
- Download the imageConverter.php file. In the same folder, create two folders: '_old' and 'new'.
- Add all images you want to convert to the '_old' folder.
Make sure you have PHP installed.
Navigate to your main folder in your console or terminal and run the PHP file:
php imageConverter.phpIt will ask if you want auto quality (75) or not...
Auto quality?(y/n); y Auto quality?(y/n); n
Pick the quality(0-100):... and if you want to crop the images or not:
Crop to square?(y/n): y
Keep Left/Top (1), Middle (2), or Right/Bottom(3)?: Crop to square?(y/n): nHere is an example of the different crop settings (Left/Top 1, Middle 2, Right/Bottom 3):
It will then browse all images in your '_old' folder and save the .webp images in the 'new' folder. It will output all scanned files for a better overview and then terminate:
./_old/toa-heftiba-U6uxileWeag-unsplash.jpg- Add HEIC images as possible source files
See the open issues for a full list of proposed features (and known issues).
Distributed under the Unlicense License. See LICENSE.txt for more information.
Photo by Toa Heftiba on Unsplash



