|
1 | | -# Convert Image Format |
2 | | -<!--Remove the below lines and add yours --> |
3 | | -These scripts can change format of images from PNG to JPG and JPG to PNG |
4 | | - |
5 | | -### Prerequisites |
6 | | -<!--Remove the below lines and add yours --> |
7 | | -Required Modules |
8 | | -- PIL==1.1.6 |
9 | | - |
10 | | -to install: |
11 | | -``` |
12 | | -$ pip install -r requirements.txt |
13 | | -``` |
14 | | - |
15 | | -### How to run the script |
16 | | -<!--Remove the below lines and add yours --> |
17 | | -- Dynamic Change |
18 | | - Copy the script convertDynamic.py into the directory where images are (PNG and/or JPG). And run: |
19 | | - ``` bash |
20 | | - $ python convertDynamic.py |
21 | | - ``` |
22 | | - This will convert all JPG images to PNG and PNG images to JPG in present directory tree recursively(.i.e. will change format in images inside sub-directories too.) |
23 | | -- JPG to PNG (single image) |
24 | | - 1. Copy the JPG image in directory where `JPGtoPNG.py` exists |
25 | | - 2. Replace file name `naruto_first.jpg` inside `JPGtoPNG.py`(line 3) to input file name(JPG). |
26 | | - 3. Replace file name `naruto.png` inside `JPGtoPNG.py`(line 4) to output file name(PNG). |
27 | | - 4. Run following command: |
28 | | - ``` |
29 | | - $ python JPGtoPNG.py |
30 | | - ``` |
31 | | -- PNG to JPG (single image) |
32 | | - 1. Copy the PNG image in directory where `PNGtoJPG.py` exists |
33 | | - 2. Replace file name `naruto_first.png` inside `PNGtoJPG.py`(line 3) to input file name(PNG). |
34 | | - 3. Replace file name `naruto.jpg` inside `PNGtoJPG.py`(line 4) to output file name(JPG). |
35 | | - 4. Run following command: |
36 | | - ``` |
37 | | - $ python PNGtoJPG.py |
38 | | - ``` |
39 | | - |
40 | | -## *Author Name* |
41 | | -<!--Remove the below lines and add yours --> |
42 | | -Xordux |
| 1 | +# Convert Image Format |
| 2 | + |
| 3 | +These scripts can change format of images from PNG to JPG and JPG to PNG |
| 4 | + |
| 5 | +### Prerequisites |
| 6 | + |
| 7 | +Required Modules |
| 8 | +- PIL==1.1.6 |
| 9 | + |
| 10 | +To install: |
| 11 | +``` |
| 12 | +$ pip install -r requirements.txt |
| 13 | +``` |
| 14 | + |
| 15 | +### How to run the script |
| 16 | + |
| 17 | +- Dynamic Change |
| 18 | + Copy the script `convertDynamic.py` into the directory where images |
| 19 | + are (PNG and/or JPG). And run: |
| 20 | + ``` bash |
| 21 | + $ python convertDynamic.py |
| 22 | + ``` |
| 23 | + This will convert all JPG images to PNG and PNG images to JPG |
| 24 | + in the present directory tree recursively |
| 25 | + (i.e. will change format in images inside sub-directories too.) |
| 26 | +- JPG to PNG (single image) |
| 27 | + 1. Copy the JPG image to the directory where `JPGtoPNG.py` exists |
| 28 | + 2. Replace file name `naruto_first.jpg` inside `JPGtoPNG.py` |
| 29 | + (line 3) to input file name (JPG). |
| 30 | + 3. Replace file name `naruto.png` inside `JPGtoPNG.py`(line 4) to |
| 31 | + output file name (PNG). |
| 32 | + 4. Run following command: |
| 33 | + ``` |
| 34 | + $ python JPGtoPNG.py |
| 35 | + ``` |
| 36 | +- PNG to JPG (single image) |
| 37 | + 1. Copy the PNG image in directory where `PNGtoJPG.py` exists |
| 38 | + 2. Replace file name `naruto_first.png` inside `PNGtoJPG.py` |
| 39 | + (line 3) to input file name (PNG). |
| 40 | + 3. Replace file name `naruto.jpg` inside `PNGtoJPG.py` |
| 41 | + (line 4) to output file name (JPG). |
| 42 | + 4. Run following command: |
| 43 | + ``` |
| 44 | + $ python PNGtoJPG.py |
| 45 | + ``` |
| 46 | + |
| 47 | +## *Author Name* |
| 48 | + |
| 49 | +[Ramon Ferreira](https://github.com/ramonfsk) |
0 commit comments