ServBay Image Processing Tool Usage Documentation
ServBay comes pre-installed with several powerful command-line image processing tools that can help you efficiently process and optimize image files. This document introduces the common image processing tools included with ServBay and provides some practical image processing tips.
Table of Contents
Common Image Processing Tools
ImageMagick
ImageMagick is a powerful suite of image manipulation tools and libraries that support multiple image formats. It offers features for creating, editing, and composing images.
Installation and Configuration
ServBay comes with ImageMagick pre-installed, so no additional installation is required.
Basic Usage
Convert image formats
bashmagick convert input.jpg output.png
1Resize images
bashmagick convert input.jpg -resize 300x300 output.jpg
1Add watermarks
bashmagick convert input.jpg -gravity southeast -draw "text 10,10 'ServBay'" output.jpg
1
cwebp
cwebp is a command-line tool for converting images to WebP format. WebP is a modern image format that provides better compression and quality.
Installation and Configuration
ServBay comes with cwebp pre-installed, so no additional installation is required.
Basic Usage
Convert JPEG images to WebP format
bashcwebp input.jpg -o output.webp
1Convert PNG images to WebP format
bashcwebp input.png -o output.webp
1Set compression quality
bashcwebp -q 80 input.jpg -o output.webp
1
jpegtran
jpegtran is a lossless JPEG transformation tool used for rotating, flipping, and transposing JPEG images.
Installation and Configuration
ServBay comes with jpegtran pre-installed, so no additional installation is required.
Basic Usage
Rotate JPEG images
bashjpegtran -rotate 90 input.jpg > output.jpg
1Horizontally flip JPEG images
bashjpegtran -flip horizontal input.jpg > output.jpg
1
djpeg
djpeg is a tool for decompressing JPEG files into PPM, PGM, BMP, or Targa formats.
Installation and Configuration
ServBay comes with djpeg pre-installed, so no additional installation is required.
Basic Usage
- Decompress JPEG to PPM formatbash
djpeg input.jpg > output.ppm
1
cjpeg
cjpeg is a tool for compressing PPM, PGM, BMP, or Targa format images into JPEG files.
Installation and Configuration
ServBay comes with cjpeg pre-installed, so no additional installation is required.
Basic Usage
- Compress PPM to JPEG formatbash
cjpeg input.ppm > output.jpg
1
img2webp
img2webp is a tool for combining multiple images into a single WebP file, commonly used for creating animated WebP.
Installation and Configuration
ServBay comes with img2webp pre-installed, so no additional installation is required.
Basic Usage
- Combine multiple images into an animated WebPbash
img2webp -o output.webp frame1.png frame2.png frame3.png
1
Image Processing Tips
Batch Resize Images
You can use ImageMagick to easily batch resize images. For example, resize all JPEG images in the current directory to 300x300 pixels:
for file in *.jpg; do magick convert "$file" -resize 300x300 "$file"; done
Batch Convert Image Formats
You can use cwebp to batch convert images to WebP format. For instance, convert all images that start with servbay
in the current directory to WebP format, and set the compression quality to 45:
for file in servbay*; do cwebp -q 45 "$file" -o "${file%.*}.webp"; done
Add Watermarks
You can use ImageMagick to add watermarks. For example, add a text watermark in the lower right corner:
magick convert input.jpg -gravity southeast -draw "text 10,10 'ServBay'" output.jpg
Optimize Image Quality
You can use jpegtran to optimize the quality and file size of JPEG images.
Optimize JPEG Images
jpegtran -optimize -progressive input.jpg > output.jpg
Conclusion
ServBay includes several powerful command-line image processing tools that can help you efficiently process and optimize image files. By following this document, you can learn how to use these tools for image processing and pick up some practical tips.