IMGP(1)
π IMGP(1) β the manual, but make it cute π
okay bestie, sit down, hydrate, because we're about to talk about imgp, a User Commands icon, and she is so good at what she does. no cap. π«Ά
β¨ NAME β¨
imgp β Resize, rotate JPEG and PNG images. that's it, that's the whole vibe. π
π SYNOPSIS π
imgp [OPTIONS] [PATH [PATH ...]]
πΈ DESCRIPTION πΈ
imgp is a multiprocessing command line image resizer and rotator for JPEG and PNG images. yes, multiprocessing. she's doing the most and doing it fast. π₯
π¦ Features π¦
- resize by percentage or resolution
- rotate clockwise by specified angle
- adaptive resize considering orientation
- brute force to a resolution
- optimize images to save more space
- limit processing by minimum image size
- convert PNG to JPEG
- erase exif metadata
- specify output JPEG image quality
- force smaller to larger resize
- process directories recursively
- overwrite source image option
look at that list. twelve features. she ate. π
π Adaptive mode π
- 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.
- 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.
For example, if an image has a resolution of 2048x1365 and is being resized to 1366x768:
- In regular mode (default), output image resolution will be
1152x768 - In adaptive mode, output image resolution will be
1366x910
not me doing math in public π but fr fr, adaptive mode is the main character here.
β Operational notes β
- Multiple files and directories can be specified as source. If PATH is omitted, the current directory is processed.
- Output image names are appended with
_IMGPif--overwriteoption is not used. By default_IMGPfiles are not processed. Doing so may lead to potential race conditions when--overwriteoption is used. - PNG files with lower target hres/vres are not converted (even if
--convertis used). Runimgp --convert (*.png)separately to convert those. - Resize and rotate are lossy operations. For additional reductions in size try
--optimizeand--eraseexifoptions. - Option
--optimizeis slower, the encoder makes an extra pass over the image in order to select optimal encoder settings. - Progressive JPEG images are saved as progressive.
π OPTIONS π
-h,--helpβ Show help text and exit. bye bestie, you're welcome π-x,--res=resβ Output resolution inHRESxVRESor percentage.-o,--rotate=degβ Rotate clockwise by a specified angle (in degrees). Negative inputs rotate anti-clockwise. Rotation by0degree is not allowed. zero is not a personality, apparently. π-a,--adaptβ Adapt to specified resolution considering the orientation of the image. Disabled by default.-c,--convertβ Convert PNG images to JPEG to save on space. The output image is saved with.jpgextension.-e,--eraseexifβ Erase EXIF metadata of JPEG images. Preserved by default.-f,--forceβ Force to the exact specified resolution. Disabled by default.-H,--hiddenβ Include hidden (dot) files. By default hidden files are skipped.-i,--includeimgpβ Process_IMGPfiles. Risky due to potential race conditions. β οΈ-k,--keepβ Do not process if image hres or vres matches specified hres or vres, or--resis100. However, PNG images are converted to JPEG if--convertoption is specified and JPEG images are made progressive is--progressiveoption is specified.-n,--enlargeβ Enlarge smaller images. By default smaller images are not scaled if specified resolution is greater.-N--nearestβ Use nearest neighbour interpolation for PNG images instead of default antialias.-p,--optimizeβ Optimize output images using PIL library optimization algorithm. Disabled by default.-P,--progressiveβ Save all output JPEG images as progressive, even if the source is not.-q,--quality=Nβ Save the image with a specified quality factor N (scale1-95, default75). JPEG only.-m,--muteβ Do not show any operational output. shhh π€«-M,--minresresβ minimum resolution inHxVor percentage of--resto resize-r,--recurseβ Recursively process sub-directories. By default only the specified directory is processed. Symbolic links are ignored to avoid recursive loops. no infinite loop drama here π-s,--size=byteβ Minimum size in bytes required to process an image. Acts as a guard against processing low-resolution images. Default1024bytes.-w,--overwriteβ Overwrite the source images. By default an output image is saved with_IMGPappended to the source image name.
NOTE: If overwrite and convert options are used together, source PNG images are deleted. π be careful bestie, that's permanent.
-d,--debugβ Enable debugging. detective mode π
π EXAMPLES π
- Convert some images and directories:
$ imgp -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:
$ imgp -x 75 -w ~/image.jpg
/home/testuser/image.jpg
1366x767 -> 1025x575
120968 bytes -> 45040 bytes
- Rotate an image clockwise by 90 degrees:
$ imgp -o 90 ~/image.jpg
120968 bytes -> 72038 bytes
- Adapt the images in the current directory to 1366x1000 resolution. Visit all directories recursively, overwrite source images, ignore images with matching hres or vres but convert PNG images to JPEG.
$ imgp -x 1366x1000 -wrack
look at that flag stack, -wrack. she's fluent. π§
- Set hres=800 and adapt vres maintaining the ratio.
$ imgp -x 800x0
Source omitted. Processing current directory...
./image1.jpg
1366x911 -> 800x534
69022 bytes -> 35123 bytes
./image2.jpg
1050x1400 -> 800x1067
458092 bytes -> 78089 bytes
- Process images greater than 50KiB only:
$ imgp -wrackx 1366x1000 -s 51200
- Generate a 64px adaptive thumbnail of the last modified file in the current dir:
#!/usr/bin/env sh
thumb64 ()
{
pop=$(ls -1t | head -1)
imgp -acx 64x64 "$pop"
}
a whole little shell function for thumbnails?? iconic. πΈ
π AUTHORS π
Arun Prakash Jana <engineerarun@gmail.com>
π HOME π
π¦ REPORTING BUGS π¦
https://github.com/jarun/imgp/issues
π LICENSE π
Copyright Β© 2016-2023 Arun Prakash Jana <engineerarun@gmail.com>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
okay that's the whole thing bestie, and here's your lil sign-off: this was Version 2.9, dated 10 Sep 2023 β written in the IMGP(1) manual, User Commands section, and yes, she's still that girl. go resize something. slay. π
β¨ππ¦π
π¦ where this page comes from
- debian trixie: imgp 2.9-1 Β· GPL-3.0-or-later
- fedora 43: imgp 2.9-6.fc43 Β· GPL-3.0-only
- fedora 44: imgp 2.9-7.fc44 Β· GPL-3.0-only
- opensuse-leap 16.0: imgp 2.9-bp160.1.9 Β· GPL-3.0-or-later
- ubuntu noble: imgp 2.9-1 Β· GPL-3.0-or-later
- ubuntu questing: imgp 2.9-1
- ubuntu resolute: imgp 2.9-1build1 Β· GPL-3.0-or-later
- ubuntu stonking: imgp 2.9-1build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms