| File | Date | Author | Commit |
|---|---|---|---|
| tools | 2016-08-16 |
|
[9adc33] Add Travis integration. |
| .travis.yml | 2016-08-16 |
|
[9adc33] Add Travis integration. |
| CHANGELOG | 2016-08-16 |
|
[b07178] Add Changelog. |
| LICENSE | 2016-08-08 |
|
[50068d] Initial commit |
| Makefile | 2016-08-13 |
|
[bed46f] Add Makefile. |
| README.md | 2016-08-15 |
|
[1747f2] Update documentation. |
| imgd | 2016-08-15 |
|
[b59a24] Create lock once. |
| imgd.1 | 2016-08-15 |
|
[1747f2] Update documentation. |
imgd (read imaged) is a multiprocessing command line image resizer and rotator for JPEG and PNG images. If you have tons of images you would like to resize adaptively to a screen-size or rotate by an angle using a single command, imgd is the utility for you.
Resize and rotation are lossy operations. In most cases, imgd will save on storage while converting to smaller resolutions. There are additional optimization options too. Output image names are appended with _IMGD if overwrite option is not used. By default _IMGD files are not processed. Doing so may lead to potential race conditions when overwrite option is used.
imgd intends to be a stronger replacement for the Nautilus Image Converter extension, not tied to any File Manager and much faster. The Nautilus Image Converter is essentially a GTK extension with a library of its own that calls the convert utility of the ImageMagick library. On desktop environments (like Xfce or LxQt) which do not integrate Nautilus, imgd will save your day.
For example, if an image has a resolution of 2048x1365 and is being resized to 1366x768:
imgd requires Python 3.5 or later. It uses the Python PIL library.
To install PIL library on Ubuntu, run:
$ sudo apt-get install python3-pil
If you have git installed, run:
$ git clone https://github.com/jarun/imgd/
or download the latest stable release or development version.
Install to default location (/usr/local):
$ sudo make install
To remove, run:
$ sudo make uninstall
PREFIX is supported. You may need to use sudo with PREFIX depending on your permissions on destination directory.
imgd is a standalone utility. From the containing directory, run:
$ ./imgd
usage: imgd [OPTIONS] PATH [PATH ...]
Resize or rotate JPEG and PNG images.
positional arguments:
PATH source file or directory
optional arguments:
-h, --help show this help message and exit
-s %, --scale % scale image by percentage
-x HxV, --res HxV output resolution in HxV representation
-o deg, --rotate deg rotate clockwise by specified angle
-a, --adapt adapt to resolution by orientation [default: off]
-c, --convert convert PNG to JPG format [default: off]
-d, --dot include hidden files (on Linux) [default: off]
-e, --eraseexif erase exif metadata [default: off]
-f, --force force to exact pecified resolution [default: off]
-i, --processimgd re-process generated files. * RISKY: refer to docs
-n, --enlarge enlarge smaller images [default: off]
-p, --optimize optimize the output images [default: off]
-q, --quiet operate silently [default: verbose]
-r, --recursive process directories recursively [default: off]
-w, --overwrite overwrite source images [default: off]
-z, --debug enable debug logs [default: off]
Convert some images and directories:
$ imgd -x 1366x768 ~/ ~/Pictures/image3.png ~/Downloads/
/home/testuser/image1.png
3840x2160 -> 1365x768
11104999 bytes -> 1486426 bytes
/home/testuser/image2.jpg
2048x1365 -> 1152x768
224642 bytes -> 31421 bytes
/home/testuser/Pictures/image3.png
1920x1080 -> 1365x768
2811155 bytes -> 1657474 bytes
/home/testuser/Downloads/image4
2048x1365 -> 1152x768
224642 bytes -> 31421 bytes
Scale an image by 75% and overwrite the source image:
$ imgd -s 75 -w ~/image.jpg
/home/testuser/image.jpg
1366x767 -> 1025x575
120968 bytes -> 45040 bytes
Rotate an image clockwise by 90 degrees:
$ imgd -o 90 ~/image.jpg
120968 bytes -> 72038 bytes
Adapt the images in the current directory to 1366x1000 resolution. Convert PNG images to JPEG, visit all directories recursively and overwrite source images.
$ imgd -x 1366x1000 -acrw .
GPLv3
Copyright (C) 2016 Arun Prakash Jana