The imgconv CLI tool allows for batch or single image conversion, resizing, watermarking, and format changes. It supports various formats including jpg, jpeg, png, gif, tif, tiff, bmp, pdf, and webp.
Common Tasks
Convert a directory of images to a specific format:
imgconv --src ./input_folder --dst ./output_folder --format png
Resize images by width and height (preserving aspect ratio if one is 0):
imgconv --src photo.jpg --dst output.png --width 800
Resize images by percentage:
imgconv --src photo.jpg --dst output.png --percent 50
Add a watermark with custom opacity and offset:
imgconv --src photo.jpg --dst output.png --watermark ./logo.png --opacity 150 -x 10 -y 10
Convert to grayscale and use a white background for transparency:
imgconv --src photo.png --dst output.jpg --gray --white-background
# Example: Convert all images in 'photos' to webp with 80% quality
imgconv --src photos --dst converted_photos --format webp --quality 80