Skip to content

Irresistible-Coding/image-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Issues Unlicense License LinkedIn


Image converter to create .webp images in bulk

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. License
  6. Acknowledgments

About The Project

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

(back to top)

Getting Started

Prerequisites

Prerequisite Screenshot

  1. Download the imageConverter.php file. In the same folder, create two folders: '_old' and 'new'.
  2. Add all images you want to convert to the '_old' folder.

Installation

Make sure you have PHP installed.

(back to top)

Usage

Navigate to your main folder in your console or terminal and run the PHP file:

  php imageConverter.php

It 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): n

Here is an example of the different crop settings (Left/Top 1, Middle 2, Right/Bottom 3):

Crop Screenshot

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

Result Screenshot Comparison Screenshot

(back to top)

Roadmap

  • Add HEIC images as possible source files

See the open issues for a full list of proposed features (and known issues).

(back to top)

License

Distributed under the Unlicense License. See LICENSE.txt for more information.

(back to top)

Acknowledgments

Photo by Toa Heftiba on Unsplash

(back to top)

About

Resize, crop and change images into webp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages