PHP Bulk Image Resizer

Create bulk image thumbnails or scale to exact size instantly with PHP and the awesome GD library. GD library is builtin with most PHP build.

This library will create thumbnails of all images from the given directory path and store them wherever you want. You can just resize proportionally, crop to exact dimension after resizing proportionally and compress to reduce image size keeping good quality.

This library comes with default HTML resized image list so that you can use it at once like a portable tool with minimum configuration!


You can download and star the library from GitHub. Click here.


Time saver! This simple 8.25 KB library gives you an awesome tool to resize hundreds of images at the minimal time. Of course the time depends on your machine, but if you do data entry work or web development, you know how much time it takes to resize images for your client. Now you can eat or watch movie or take a nap while this tool does your work in under a minute!

Builtin HTML! Yes, it comes with builtin HTML list to show you which images are resized and which are not (i.e. if its not a image file). You can remove the HTML with a simple configuration ‘resize_list’ => false and use on your own project.

Auto directory creation! This tool will create its own image folder and resized thumbnail folder if not specified. You can define your own image folder path and thumbnail folder path.

Memory limit & Execution time as needed! It also tries to increase PHP memory limit and file execution time to resize large number of files.

Proportional resize! This library resizes images proportionally. It fits the width and height as much as possible.

Exact resize and corp from center! Best feature of this utility is it make your image exact size you want. You’ll get all of your images first resized proportionally, then cropped from the center, if the image is still large.

Compress images! Your image files are too large for the web? Just send an argument and compress your images as much as you want. This library will automatically reduce image sizes as they will be resized and lose some pixels. Additional compression will be done using JPEG image quality. Use CSS opacity style code here, 0.8 means image quality 80% whereas 0.65 means 65% and 1 means 100%. See the image below, before resize 188MB only 15 images and after resized to 750x600px, it comes down to 547KB all with 80% image compression. Cool, huh?

Single image resize! Of course you can resize a single image with createThumbnail() function.

And more!

Coming soon: Watermark on all images at once!


Require the class.imageresizer.php from your file.

You can just use default properties by just:

See here for full doc:


This is how it works:


Md. Hasan Shahriar


Do whatever you want, keep me in your prayers! Happy coding with love!

The Invisible Man | Machine Learning Engineer, Programmer, Tech Enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store