Skip to main content
# BulkImageResizer

BulkImageResizer automates image resizing and compression of any number of images in a folder. I developed this script to automatically resize and compress the images for responsive front end web development.

## Getting Started

Followig instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

No prerequisites. BulkImageResizer is compatible with both Python2 and Python3.

### Installation

* Basic installation on your default Python version. Type in following code on your terminal:
```
$ pip install BulkImageResizer
```
If you want to install on a different Python version than default then:
* if default is Python2, then to install on Python3:
```
$ python3 -m pip install BulkImageResizer
```
* if default is Python3, then to install on Python2:
```
$ python2 -m pip install BulkImageResizer
```

## Usage

1. First import the module using the following command on your python project.
```
from BulkImageResizer.BulkImageResizer import BulkImageResizer
```
2. Instantiate BulkImageResizer object with the following arguments:
* path to source folder (containing images)
* path to new folder (to save resized images).
here is an example:
```
sourceFolder = '/Users/SK/Desktop/sourceFolder/'
exportFolder = '/Users/SK/Desktop/exportFolder/'

test1 = BulkImageResizer(sourceFolder, exportFolder)
```
3.1 To resize the image use imageResize() method. It takes minimum two integer numbers as arguments, which indicates the size you want in pixels.
here is an example:
```
test1.imageResize(800, 600)
```
this will resize all the images in the sourceFolder according to given pixels and save them in exportFolder. The original photos in the sourceFolder will not change.
If you want to keeps aspect ratio unchanged then use the following:
```
test1.imageResize(800, 600, aspectRatio=False)
```
this will resize all the images in the sourceFolder so that no matter what the length of the longer side of the image will equal 800px and the length of the shorter side of the image will be calculated based on the aspect ration of the original image. The resized images will be saved in exportFolder.
You can also change the subsampling value and quality of the image. By default subsampling is set to 1 and can be changed from 0 up to 2. Quality is set to 95, which is the maximum quality and can be lowered if you would like to compress the image and decrease file size.
```
test1.imageResize(800, 600, subsampling=2, quality=85)
```
3.2 If you want to just comress the photo without changing the pixel size then you can use imageCompress() method. By default quality is set to 95. If you would like to decrease the file size then you can lower the quality.
```
test1.imageComress(quality=75)
```

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

## Version

Current Version: 1.0.3. For the versions available, see the [tags on this repository](https://github.com/suhrabjan/BulkImageResizer/tags).

## Authors

**Suhrab Kurbanov** - *Initial work*
See also the list of [contributors](https://github.com/suhrabjan/BulkImageResizer/graphs/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgements

Hat tip to anyone whose code was used


Metadata

Release files for BulkImageResizer 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BulkImageResizer 1.0.4
File Size Uploaded
BulkImageResizer-1.0.4.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for BulkImageResizer 1.0.4
File Interpreter ABI Platform
BulkImageResizer-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / BulkImageResizer-1.0.4.tar.gz

Download URL BulkImageResizer-1.0.4.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ba4baafc174382784809f777a3ad9983d84ad68aa6c35f489e8e7a75ebee089d
BLAKE2b-256 checksum
How to use checksums
e384cab3868b66d4c70930eee05ba16fb948fd5ff39dfea5349f01ac7135a174
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release files / BulkImageResizer-1.0.4-py3-none-any.whl

Download URL BulkImageResizer-1.0.4-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
574a97669ed2dd4025e96557434c4c5f03c3760d3eabdb1f7d9ce0fb46be8e92
BLAKE2b-256 checksum
How to use checksums
17d7c2557bbffebb6cec042246f2cabbdd09c243fb4fe0a80a8ee0302b27e75b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page