You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-32Lines changed: 33 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,33 +14,33 @@
14
14
15
15
`imgp` is a command line image resizer and rotator for JPEG and PNG images. If you have tons of images you want to resize adaptively to a screen resolution or rotate by an angle using a single command, `imgp` is the utility for you. It can save a lot on storage too.
16
16
17
-
Powered by an intelligent adaptive algorithm, recursive operations, multiprocessing, shell completion scripts, EXIF preservation (and more), `imgp` is a very flexible utility with well-documented easy to use options.
17
+
Powered by multiprocessing, an intelligent adaptive algorithm, recursive operations, shell completion scripts, EXIF preservation (and more), `imgp` is a very flexible utility with well-documented easy to use options.
18
18
19
19
`imgp` intends to be a stronger replacement of the Nautilus Image Converter extension, not tied to any file manager and way faster. On desktop environments (like Xfce or LxQt) which do not integrate Nautilus, `imgp` will save your day.
20
20
21
-
<palign="center">
21
+
<palign="right">
22
22
<ahref="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q"><imgsrc="https://tuxtricks.files.wordpress.com/2016/12/donate.png"alt="Donate via PayPal!"title="Donate via PayPal!" /></a>
23
23
</p>
24
24
25
-
## Table of Contents
25
+
###Table of Contents
26
26
27
27
-[Features](#features)
28
28
-[Adaptive mode](#adaptive-mode)
29
29
-[Performance](#performance)
30
30
-[Installation](#installation)
31
31
-[Dependencies](#dependencies)
32
-
-[Installing from this repository](#installing-from-this-repository)
33
-
-[Running as a standalone utility](#running-as-a-standalone-utility)
34
32
-[Installing with a package manager](#installing-with-a-package-manager)
35
-
-[Debian package](#debian-package)
33
+
-[Installing from this repository](#installing-from-this-repository)
34
+
-[Running as a standalone utility](#running-as-a-standalone-utility)
35
+
-[Debian package](#debian-package)
36
36
-[Shell completion](#shell-completion)
37
37
-[Usage](#usage)
38
38
-[cmdline options](#cmdline-options)
39
39
-[Operational notes](#operational-notes)
40
40
-[Examples](#examples)
41
41
-[Copyright](#copyright)
42
42
43
-
## Features
43
+
###Features
44
44
45
45
- resize by percentage or resolution
46
46
- rotate clockwise by specified angle
@@ -56,7 +56,7 @@ Powered by an intelligent adaptive algorithm, recursive operations, multiprocess
56
56
- completion scripts for bash, fish, zsh
57
57
- minimal dependencies
58
58
59
-
### Adaptive mode
59
+
####Adaptive mode
60
60
61
61
- If the specified and image orientations are same [(H >= V and h > v) or (H < V and h < v)], the image is resized with the longer specified side as reference.
62
62
- In case of cross orientation [(H >= V and h <= v) or (H < V and h >= v)], the image is resized with the shorter specified side as reference. Same as non-adaptive.
@@ -66,15 +66,15 @@ For example, if an image has a resolution of 2048x1365 and is being resized to 1
66
66
- In regular mode (default), output image resolution will be 1152x768
67
67
- In adaptive mode, output image resolution will be 1366x910
68
68
69
-
## Performance
69
+
###Performance
70
70
71
-
`imgp` could resize 8823 images (~4.5GB in size) of mixed resolutions (high to regular) stored in an external USB 2.0 hard disk at an adaptive resolution of 1366x1000 in around 8 minutes. The resulting size was 897MB (~ 20%).
71
+
`imgp` could resize 8823 images (approx. 4.5GB in size) of mixed resolutions (high to regular) stored in a USB 2.0 external hard disk at an adaptive resolution of 1366x1000 in around 8 minutes. The resulting size was 897MB (approx. 20%).
72
72
73
73
`imgp` uses Python PIL/Pillow library. Nautilus Image Converter calls the `convert` utility from ImageMagick. For a comparative benchmark, head [here](https://github.com/uploadcare/pillow-simd#benchmarks).
74
74
75
-
## Installation
75
+
###Installation
76
76
77
-
### Dependencies
77
+
####Dependencies
78
78
79
79
`imgp` requires Python 3.5 or later.
80
80
@@ -88,12 +88,16 @@ or, using pip3:
88
88
89
89
pillow can be replaced by [pillow-simd](https://github.com/uploadcare/pillow-simd) on [SIMD](https://en.wikipedia.org/wiki/SIMD) processors.
or download the latest [stable release](https://github.com/jarun/imgp/releases/latest) or [development version](https://github.com/jarun/imgp/archive/master.zip).
100
+
If you have git installed, clone this repository. Otherwise download the latest [stable release](https://github.com/jarun/imgp/releases/latest) or [development version](https://github.com/jarun/imgp/archive/master.zip) (*risky*).
97
101
98
102
Install to default location (`/usr/local`):
99
103
@@ -104,33 +108,26 @@ To remove, run:
104
108
$ sudo make uninstall
105
109
`PREFIX` is supported. You may need to use `sudo` with `PREFIX` depending on your permissions on destination directory.
106
110
107
-
### Running as a standalone utility
111
+
#####Running as a standalone utility
108
112
109
113
`imgp` is a standalone utility. From the containing directory, run:
If you are on a Debian based system (including Ubuntu), visit [the latest stable release](https://github.com/jarun/imgp/releases/latest) and download the `.deb` package. To install, run
123
120
124
121
$ sudo dpkg -i imgp-$version-all.deb
125
122
Please substitute `$version` with the appropriate package version.
126
123
127
-
## Shell completion
124
+
###Shell completion
128
125
129
126
Shell completion scripts for Bash, Fish and Zsh can be found in respective subdirectories of [auto-completion/](https://github.com/jarun/imgp/blob/master/auto-completion). Please refer to your shell's manual for installation instructions.
130
127
131
-
## Usage
128
+
###Usage
132
129
133
-
### cmdline options
130
+
####cmdline options
134
131
135
132
usage: imgp [OPTIONS] [PATH [PATH ...]]
136
133
@@ -160,14 +157,14 @@ Shell completion scripts for Bash, Fish and Zsh can be found in respective subdi
- Multiple files and directories can be specified as source. If `PATH` is omitted, the current directory is processed.
166
163
- Output image names are appended with **_IMGP** if `--overwrite` option is not used. By default *_IMGP* files are not processed. Doing so may lead to potential race conditions when `--overwrite` option is used.
167
164
- PNG files with lower target hres/vres are not converted (even if `--convert` is used). Run `imgp --convert` to convert those.
168
165
- Resize and rotate are lossy operations. For additional reductions in size try `--optimize` and `--eraseexif` options.
169
166
170
-
## Examples
167
+
###Examples
171
168
172
169
1. Convert some images and directories:
173
170
@@ -217,6 +214,10 @@ Shell completion scripts for Bash, Fish and Zsh can be found in respective subdi
217
214
1050x1400 -> 800x1067
218
215
458092 bytes -> 78089 bytes
219
216
220
-
## Copyright
217
+
6. Process images greater than 50KB (50*1024 bytes) only:
Copy file name to clipboardExpand all lines: imgp.1
+18-11Lines changed: 18 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -28,19 +28,19 @@ is a multiprocessing command line image resizer and rotator for JPEG and PNG ima
28
28
- In case of cross orientation [(H >= V and h <= v) or (H < V and h >= v)], the image is resized with the shorter specified side as reference. Same as non-adaptive.
29
29
.PP
30
30
For example, if an image has a resolution of 2048x1365 and is being resized to 1366x768:
31
-
.PP
31
+
.br
32
32
- In regular mode (default), output image resolution will be 1152x768
33
33
.br
34
34
- In adaptive mode, output image resolution will be 1366x910
35
35
.PP
36
36
.BOperationalnotes
37
37
.PP
38
38
- Multiple files and directories can be specified as source. If \fBPATH\fR is omitted, the current directory is processed.
39
-
.PP
39
+
.br
40
40
- Output image names are appended with \fB_IMGP\fR if '--overwrite' option is not used. By default \fB_IMGP\fR files are not processed. Doing so may lead to potential race conditions when '--overwrite' option is used.
41
-
.PP
41
+
.br
42
42
- PNG files with lower target hres/vres are not converted (even if '--convert' is used). Run 'imgp --convert' to convert those.
43
-
.PP
43
+
.br
44
44
- Resize and rotate are lossy operations. For additional reductions in size try '--optimize' and '--eraseexif' options.
45
45
.SH OPTIONS
46
46
.TP
@@ -65,16 +65,16 @@ Include hidden files (Linux-specific). By default hidden files are skipped on Li
65
65
.BI"-e, --eraseexif"
66
66
Erase EXIF metadata of JPEG images. Preserved by default.
67
67
.TP
68
-
.B"-f,--force"
68
+
.BI"-f, --force"
69
69
Force to the exact specified resolution. Disabled by default.
70
70
.TP
71
-
.B"-i,--includeimgp"
71
+
.BI"-i, --includeimgp"
72
72
Process \fI_IMGP\fR files. Risky due to potential race conditions.
73
73
.TP
74
-
.B"-k,--keep"
74
+
.BI"-k, --keep"
75
75
Do not process if image hres or vres matches specified hres or vres, or --res is 100. However, PNG images are converted to JPEG if --convert option is specified.
76
76
.TP
77
-
.B"-n,--enlarge"
77
+
.BI"-n, --enlarge"
78
78
Enlarge smaller images. By default smaller images are not scaled if specified resolution is greater.
79
79
.TP
80
80
.BI"-p, --optimize"
@@ -83,10 +83,10 @@ Optimize output images using PIL library optimization algorithm. Disabled by def
83
83
.BI"-q, --quiet"
84
84
Do not show any operational output.
85
85
.TP
86
-
.B"-r,--recursive"
86
+
.BI"-r, --recursive"
87
87
Recursively process sub-directories. By default only the specified directory is processed. Symbolic links to directories are ignored to avoid recursive loops.
88
88
.TP
89
-
.B"-s,--recursive="byte
89
+
.BI"-s, --recursive="byte
90
90
Minimum size in bytes required to process an image. Acts as a guard against processing low-resolution images. Default 1024 bytes.
91
91
.TP
92
92
.BI"-w, --overwrite"
@@ -152,7 +152,6 @@ Visit all directories recursively, overwrite source images, ignore images with m
152
152
.B$imgp-x1366x1000-wrack
153
153
.EE
154
154
.PP
155
-
.EX
156
155
.IP5.4
157
156
Set hres=800 and adapt vres maintaining the ratio.
158
157
.PP
@@ -168,6 +167,14 @@ Source omitted. Processing current directory...
168
167
\[char46]/image2.jpg
169
168
1050x1400 -> 800x1067
170
169
458092 bytes -> 78089 bytes
170
+
.EE
171
+
.PP
172
+
.IP6.4
173
+
Process images greater than 50KB (50*1024 bytes) only:
0 commit comments