Skip to content

Commit 20d67e8

Browse files
Merge pull request #810 from neelshah2409/main
Image Size Compressor
2 parents 64f2b48 + afa9656 commit 20d67e8

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed
292 KB
Loading
306 KB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Image Size Compressor
2+
3+
## Aim/Purpose
4+
To compress the size of the image without changing the dimensions
5+
6+
## Short description of package/script
7+
8+
- Here using the Image module of PIL library we convert the size the image without changing the dimension of the image the reduced image will be there in the same folder as of the script.
9+
-Here we can also change the size of the image if we wanted by mentioning it in the script.
10+
- List out the libraries imported>PIL(pillow)
11+
12+
## Workflow of the Project
13+
14+
Here take the image which you wanted to reduce the size in the same folder as of script then run the script so the output reduced image will be there as output.
15+
16+
17+
## Setup instructions
18+
First install the library then run the script so the reduced size image will be there as output in the same folder as of script.
19+
20+
21+
## Output
22+
23+
![image](Images/output_1(img_compressor).png)
24+
![image](Images/output_2(img_compressor).png)
25+
26+
## Author(s)
27+
28+
Neel Shah
29+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import PIL
2+
from PIL import Image
3+
4+
mywidth=3278 #width of the image to be obtained
5+
myheight=4917 #height of the image to be obtained
6+
7+
#opening the image
8+
img=Image.open('cute_dog.jpg')
9+
#resizing the image
10+
img=img.resize((mywidth,myheight),PIL.Image.ANTIALIAS)
11+
#saving the image
12+
img.save('resize.jpg')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Library used:PIL(pillow)

0 commit comments

Comments
 (0)