Download and install XnConvert
XnConvert is the batch image editing brother of the more popular XnView image viewer. Download the package that’s best for your distribution. Since we are doing this on Kubuntu on a relatively modern PC, we chose the 64-bit DEB package. Use your preferred approach to install the package you downloaded. In our case, we right-clicked on the downloaded file and selected “Open with QApt Package Installer.” Proceed with the installation of the program and, when it completes, run it.
Setup resizing
Ignore the initial “Input” tab for now, and move to the “Actions” one. Since our goal is to simplify the batch resizing and compression of masses of images, add the “Resize” action to the active script with a click on “Add action -> Image -> Resize.” If you wish, you can add more actions, but we will keep things simple and stick to a single one for now. Click on the pull-down menu next to “Mode” and change its setting from “Fit” to “Width.” “Width” states that we want to resize the images so that they will all have the maximum width we define. Their height might vary from image to image. Change the “Enlarge/Reduce” parameter from “Always” to “Reduce only.” This way, XnConvert will shrink any images larger than the width we set, but won’t also enlarge (also known as “upscale”) any smaller images, keeping them in their native resolution.
Setup output
Move to the “Output” tab and note how the program also allows you to output the converted images to zip files, emails, Flickr albums, etc. Those might come in handy in the future. For now, though, leave it at “Folder.” If you wish, you can tweak the naming scheme of the produced images, in the “Filename” field. Note that the “{filename}” pattern keeps the original name of each file. Your images might be in many different formats, but for the web, JPEGs still reign supreme. To have all your images converted to this format, click on the pull-down menu under “Format,” with the “As original” default value, and change it to “JPG – JPEG/JFIF.” Each format comes with its own settings, accessible from the “Settings” button directly underneath the pull-down menu. In the case of JPEG files, the most crucial parameter is the compression/quality ratio. You can modify that from the slider at the top of the settings window. The more you move it to the right, the better the quality, but the less the compression. XnConvert doesn’t utilize more than one CPU cores by default. To do that, and get a nice speed boost, enable “Use CPU Cores” at the bottom left, and use the slider next to it to set the number of cores. Note that this is incompatible both with multipage files and with the “Ask” setting in “When output files already exist.” To use multiple cores, disable the multipage support and set the “When output files already exist” option to one of the other settings, “Replace”, “Skip” or “Rename.”
Save different scripts
With everything set up the way we want it, it’s time to save all those settings in a profile, for easy reuse in the future. To do that, click on the little button on the bottom left with the diskette icon. Choose the folder where it will be saved and provide a file name for your script in the window that pops up. Since the site here uses a different image size for its featured images, we decided to create a second script for that. We were happy with the options as they were and only wanted a different width and height, so we moved back to the “Actions” tab and modified the options for this scenario. We changed the mode to “Fill,” so that the image would expand to the defined width and height, with no black borders, and everything exceeding those dimensions auto-cropped. Then, we entered the desired width and height and made sure “Keep ratio” was enabled to ensure the images wouldn’t be deformed. As before, we saved this as a second profile, with a different name, for future use.
Input and convert
That was all – from now on, “preparing” a bunch of images for your blog is only a matter of drag and dropping them in the application, selecting the appropriate profile and converting them. To try it out, open your favorite file manager and point it to a folder with some images. Drag and drop them to the application’s window to add them to its queue. If you wish, you can add more images from different folders to the queue by repeating this step. Move to the “Output” tab, where we had intentionally left the destination blank. Choose a folder where you want the converted files to be saved. Click on the “Convert” button, on the bottom right, to start the procedure. After a small wait, you will find all converted files in the folder you chose in output minutes ago. And if you replicated our settings, they should all be compressed JPG’s smaller than 700 pixels in width.