Skip to content

Commit 2923f00

Browse files
committed
Reformat README
1 parent 59751f4 commit 2923f00

File tree

2 files changed

+51
-43
lines changed

2 files changed

+51
-43
lines changed

README.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@
1414

1515
`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.
1616

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.
1818

1919
`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.
2020

21-
<p align="center">
21+
<p align="right">
2222
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q"><img src="https://tuxtricks.files.wordpress.com/2016/12/donate.png" alt="Donate via PayPal!" title="Donate via PayPal!" /></a>
2323
</p>
2424

25-
## Table of Contents
25+
### Table of Contents
2626

2727
- [Features](#features)
2828
- [Adaptive mode](#adaptive-mode)
2929
- [Performance](#performance)
3030
- [Installation](#installation)
3131
- [Dependencies](#dependencies)
32-
- [Installing from this repository](#installing-from-this-repository)
33-
- [Running as a standalone utility](#running-as-a-standalone-utility)
3432
- [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)
3636
- [Shell completion](#shell-completion)
3737
- [Usage](#usage)
3838
- [cmdline options](#cmdline-options)
3939
- [Operational notes](#operational-notes)
4040
- [Examples](#examples)
4141
- [Copyright](#copyright)
4242

43-
## Features
43+
### Features
4444

4545
- resize by percentage or resolution
4646
- rotate clockwise by specified angle
@@ -56,7 +56,7 @@ Powered by an intelligent adaptive algorithm, recursive operations, multiprocess
5656
- completion scripts for bash, fish, zsh
5757
- minimal dependencies
5858

59-
### Adaptive mode
59+
#### Adaptive mode
6060

6161
- 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.
6262
- 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
6666
- In regular mode (default), output image resolution will be 1152x768
6767
- In adaptive mode, output image resolution will be 1366x910
6868

69-
## Performance
69+
### Performance
7070

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%).
7272

7373
`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).
7474

75-
## Installation
75+
### Installation
7676

77-
### Dependencies
77+
#### Dependencies
7878

7979
`imgp` requires Python 3.5 or later.
8080

@@ -88,12 +88,16 @@ or, using pip3:
8888

8989
pillow can be replaced by [pillow-simd](https://github.com/uploadcare/pillow-simd) on [SIMD](https://en.wikipedia.org/wiki/SIMD) processors.
9090

91-
### Installing from this repository
91+
#### Installing with a package manager
92+
93+
- [AUR](https://aur.archlinux.org/packages/imgp/)
94+
- [Debian](https://packages.debian.org/search?keywords=imgp&searchon=names&exact=1)
95+
- [Ubuntu](http://packages.ubuntu.com/search?keywords=imgp&searchon=names&exact=1)
96+
- [Ubuntu PPA](https://launchpad.net/~twodopeshaggy/+archive/ubuntu/jarun/)
9297

93-
If you have git installed, run:
98+
#### Installing from this repository
9499

95-
$ git clone https://github.com/jarun/imgp/
96-
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*).
97101

98102
Install to default location (`/usr/local`):
99103

@@ -104,33 +108,26 @@ To remove, run:
104108
$ sudo make uninstall
105109
`PREFIX` is supported. You may need to use `sudo` with `PREFIX` depending on your permissions on destination directory.
106110

107-
### Running as a standalone utility
111+
##### Running as a standalone utility
108112

109113
`imgp` is a standalone utility. From the containing directory, run:
110114

111115
$ ./imgp
112116

113-
### Installing with a package manager
114-
115-
- [AUR](https://aur.archlinux.org/packages/imgp/)
116-
- [Debian](https://packages.debian.org/search?keywords=imgp&searchon=names&exact=1)
117-
- [Ubuntu](http://packages.ubuntu.com/search?keywords=imgp&searchon=names&exact=1)
118-
- [Ubuntu PPA](https://launchpad.net/~twodopeshaggy/+archive/ubuntu/jarun/)
119-
120-
### Debian package
117+
##### Debian package
121118

122119
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
123120

124121
$ sudo dpkg -i imgp-$version-all.deb
125122
Please substitute `$version` with the appropriate package version.
126123

127-
## Shell completion
124+
### Shell completion
128125

129126
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.
130127

131-
## Usage
128+
### Usage
132129

133-
### cmdline options
130+
#### cmdline options
134131

135132
usage: imgp [OPTIONS] [PATH [PATH ...]]
136133

@@ -160,14 +157,14 @@ Shell completion scripts for Bash, Fish and Zsh can be found in respective subdi
160157
-w, --overwrite overwrite source images [default: off]
161158
-z, --debug enable debug logs [default: off]
162159

163-
### Operational notes
160+
#### Operational notes
164161

165162
- Multiple files and directories can be specified as source. If `PATH` is omitted, the current directory is processed.
166163
- 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.
167164
- PNG files with lower target hres/vres are not converted (even if `--convert` is used). Run `imgp --convert` to convert those.
168165
- Resize and rotate are lossy operations. For additional reductions in size try `--optimize` and `--eraseexif` options.
169166

170-
## Examples
167+
### Examples
171168

172169
1. Convert some images and directories:
173170

@@ -217,6 +214,10 @@ Shell completion scripts for Bash, Fish and Zsh can be found in respective subdi
217214
1050x1400 -> 800x1067
218215
458092 bytes -> 78089 bytes
219216

220-
## Copyright
217+
6. Process images greater than 50KB (50*1024 bytes) only:
218+
219+
$ imgp -wrackx 1366x1000 -s 51200
220+
221+
### Copyright
221222

222-
Copyright © 2016-2017 [Arun Prakash Jana](mailto:engineerarun@gmail.com)
223+
Copyright © 2016-2017 [Arun Prakash Jana](https://github.com/jarun)

imgp.1

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ is a multiprocessing command line image resizer and rotator for JPEG and PNG ima
2828
- 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.
2929
.PP
3030
For example, if an image has a resolution of 2048x1365 and is being resized to 1366x768:
31-
.PP
31+
.br
3232
- In regular mode (default), output image resolution will be 1152x768
3333
.br
3434
- In adaptive mode, output image resolution will be 1366x910
3535
.PP
3636
.B Operational notes
3737
.PP
3838
- Multiple files and directories can be specified as source. If \fBPATH\fR is omitted, the current directory is processed.
39-
.PP
39+
.br
4040
- 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
4242
- 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
4444
- Resize and rotate are lossy operations. For additional reductions in size try '--optimize' and '--eraseexif' options.
4545
.SH OPTIONS
4646
.TP
@@ -65,16 +65,16 @@ Include hidden files (Linux-specific). By default hidden files are skipped on Li
6565
.BI "-e, --eraseexif"
6666
Erase EXIF metadata of JPEG images. Preserved by default.
6767
.TP
68-
.B "-f, --force"
68+
.BI "-f, --force"
6969
Force to the exact specified resolution. Disabled by default.
7070
.TP
71-
.B "-i, --includeimgp"
71+
.BI "-i, --includeimgp"
7272
Process \fI_IMGP\fR files. Risky due to potential race conditions.
7373
.TP
74-
.B "-k, --keep"
74+
.BI "-k, --keep"
7575
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.
7676
.TP
77-
.B "-n, --enlarge"
77+
.BI "-n, --enlarge"
7878
Enlarge smaller images. By default smaller images are not scaled if specified resolution is greater.
7979
.TP
8080
.BI "-p, --optimize"
@@ -83,10 +83,10 @@ Optimize output images using PIL library optimization algorithm. Disabled by def
8383
.BI "-q, --quiet"
8484
Do not show any operational output.
8585
.TP
86-
.B "-r, --recursive"
86+
.BI "-r, --recursive"
8787
Recursively process sub-directories. By default only the specified directory is processed. Symbolic links to directories are ignored to avoid recursive loops.
8888
.TP
89-
.B "-s, --recursive=" byte
89+
.BI "-s, --recursive=" byte
9090
Minimum size in bytes required to process an image. Acts as a guard against processing low-resolution images. Default 1024 bytes.
9191
.TP
9292
.BI "-w, --overwrite"
@@ -152,7 +152,6 @@ Visit all directories recursively, overwrite source images, ignore images with m
152152
.B $ imgp -x 1366x1000 -wrack
153153
.EE
154154
.PP
155-
.EX
156155
.IP 5. 4
157156
Set hres=800 and adapt vres maintaining the ratio.
158157
.PP
@@ -168,6 +167,14 @@ Source omitted. Processing current directory...
168167
\[char46]/image2.jpg
169168
1050x1400 -> 800x1067
170169
458092 bytes -> 78089 bytes
170+
.EE
171+
.PP
172+
.IP 6. 4
173+
Process images greater than 50KB (50*1024 bytes) only:
174+
.PP
175+
.EX
176+
.IP
177+
.B $ imgp -wrackx 1366x1000 -s 51200
171178
.SH AUTHORS
172179
Arun Prakash Jana <engineerarun@gmail.com>
173180
.SH HOME

0 commit comments

Comments
 (0)