Skip to content

Archive

Image Processing

3 articles
Linux 26 Sep 2026 4 min read

Batch Resize Images with Bash and ImageMagick Without Overwriting Originals

A resize command is straightforward. Keeping a batch recoverable takes more care. Writing results over the source images can leave a collection only partly processed if a conversion fails. Flattening every result into one folder also creates collisions: events/photo.jpg and products/photo.jpg would have the same destination name. A separate output tree avoids both problems. The script below accepts a source directory, a destination directory, and a maximum edge length. It processes JPEG, PNG, and WebP files recursively, retains their relative paths and formats, and leaves the originals alone.

Linux 26 Sep 2026 5 min read

Batch Convert JPEG and PNG to WebP with Bash and cwebp

Two files named photo.jpg and photo.png in the same directory would both become photo.webp. A batch converter that notices the collision only after it starts encoding may leave one image unconverted or replace an earlier result. It is better to check the entire input list first. The Bash script here uses cwebp for encoding and keeps a separate output tree. Its default auto mode encodes JPEG with lossy WebP and PNG with lossless WebP. The source images stay in place; existing destination files are skipped.

Tech 05 Sep 2026 8 min read

Why Your Phone Camera Preview Can Look Different From the Final Photo

You frame a photo on your phone, tap the shutter, and then notice that the saved image does not look exactly like the viewfinder did a moment earlier. Shadows may be brighter, highlights may be less intense, colours can shift slightly, or fine detail may look sharper or smoother. That does not necessarily mean the camera captured the wrong image. The live preview and the finished photo have different jobs. The preview must update quickly enough to help you compose the shot, while the final photo can receive additional processing after you press the shutter.