I’m trying to really focus on Ubuntu Linux and have a good sense of how to get most things done. Except I can’t figure out how to resize photos for posting to social media. How can I resize a graphic or photo in Linux?
Great to hear that you’re focused on learning Linux. After so many decades of evolution and hundreds of programmers worldwide developing apps and utilities, there’s very little that can’t be easily — or somewhat easily! — done within the Linux environment. I’m also a fan of Ubuntu Linux and have been for many years, so that’s a good choice too in terms of which “flavor” works best for a basic user. If you’re hardcore into cyber-currency, security or development there are specific distros for your interest (IT Pros has a good list of best modern Linux distros if you’re interested).
But back to your question! There are a number of graphics and photo editing programs available for Linux, perhaps most notably a program with the rather awkward name of GIMP (which stands for “GNU Image Manipulation Program”). Turns out that there’s a pretty slick program included with the Ubuntu distro that can do the job of resizing your image too, though it’s not at all obvious how to accomplish the task!
To start out, I’m going to grab a ridiculously cute picture of a kitten from Dimitri Houtteman as posted to Pixabay:
Double click on it and you’ll open the image up in a program called Image Viewer:
As you can see, this image is taking up most of the screen, and it’s only showing at 75% size. There are no meaningful edit tools included with Image Viewer, however, since it’s just for, well, viewing images.
Instead, right-click on the photo file icon and you’ll find that you can choose to “open with other program” and then see a list of what apps and utilities you have with your Ubuntu distro that can display a JPEG image:
The name doesn’t suggest it’s an editor, but the Shotwell Viewer has a decent number of edit and image manipulation tools available, so click to choose that for displaying and editing the photo or image file. This time it opens up with manipulation controls right on the window frame:
Here’s what’s confusing, though: Shotwell Viewer doesn’t offer any image resizing or scaling options. Not on one of the program menus, not on a right-click context menu, not along the bottom toolbar.
Ummm, I thought you said that you could resize an image with Shotwell Viewer?
Don’t panic. You can resize, but for reasons I cannot explain, image scaling is a part of the file save process and available nowhere else in the program. So let’s just go to save the image… Choose “Save As…” from the “File” menu and here’s the dialog box you’ll see:
As you can see, there are quite a few options tucked into the save dialog! You can change formats, shrink the file size by lowering image quality, and resize the image as you save it! The current photo width is 1200 pixels, as shown, so let’s cut that down 50%.
A click on “Original size” as the Scaling constraint and you’ll see these options:
Choose “Width” to specify the constrained dimension and you’ll have the ability to just type in the desired image width, knowing it’ll all be rescaled in a completely proportional manner:
I’m specifying that I want a version of the image that’s 500 pixels wide, rather than 1200 pixels of the original. That’ll shrink it down and make it much faster to work with online.
Finally, all looks good, so a click on the green “OK” offers me the chance to name the new image file:
I’m adding the “-500” suffix to the filename as you can see. This lets me have two versions of the image in case I don’t like how it appears at 500 pixel width. Always smart to retain the original image until you’re completely satisfied with the result!
Now I can check the file properties with a right click to find out its dimensions:
Worked great, didn’t it? The original file was 639KB and the new 500×333 image is 49KB. Quite a bit smaller!
Note: I added the image icon preview to the above graphic for display purposes. Your Properties > Image won’t normally include that. Though it could, couldn’t it? 🙂
So that’s it. A somewhat hidden but reasonably easy method of scaling and resizing photos and other images within Ubuntu Linux without downloading or installing any additional graphics editor software.
Pro Tip: I’ve been using Linux since the beginning of the operating system. I have a lot of Linux help here on the site, including tons of Linux scripting help too. Please take the time to check it out while you’re here!