Taking those screenshots is often a pretty simple and quick process. The burden comes when I have to open all of them and start saving them as JPG, in an attempt to reduce their size and make them more "Internet-compatible". What's even worse is that each of those files must also be reduced in size to provide thumbnails that I can instert in my articles. Long story short, each PNG file has to be converted into a full size JPG image, then reduced to match thumbnail size and saved as a separate JPG image.
Those of you who know about the
convertcommand and the IMAGEMAGICK PROJECT are probably scratching your heads, wondering why I am wasting my time in something that can easily be achieved from the command line, but what can I say... I only learned about this awesome tool very recently!
CONVERT, CONVERT, CONVERT...
Alright, so if you didn't know about the
convertcommand, just a a quick look at its help page from the command line should give you an overview of what it offers. Assuming it is installed on your machine (if not, from a terminal type
sudo apt-get install imagemagick), type the following from a terminal:
To give you a quick idea, this powerful command can pretty much perform any operation or set of operations on an image that one could do using GIMP. Here's a short list of highlights:
- Convert image format
- Switch to sepia or B/W.
- Change contrast and brightness balance
- Merge layers
- Gamma correction
- Flip/flop image vertically/horizontally.
- Many, many more...
This is all very nice, but you may be wondering what all of this has to do with my Blog and all that time I waste manually converting images and creating thumbnails? Well, thanks to the power of the command line, I could automate the whole process, so I now get all my image conversion and thumbnail creation done with a couple clicks in just a few seconds!
Let me introduce
PiConvert.sh, a simple script I created to get all this image conversion business automated. Its functionality is simple and perhaps limited to my needs, but could easily be tweaked to extend it if needed. Here's how it works:
1.- After running the script, a welcome dialog appears which briefly explains how things work:
2.- If the user decides to continue, a file-selection dialog shows up, allowing for single or multiple file selection (the images that should eventually be converted).
3.- Next is a directory-selection dialog, which allows the user to select the destination where those converted files will be saved to.
The script will now proceed to convert files and create the corresponding thumbnails, all of which will be saved at the specified target location.
PiConvert.shprovides functionality you think you could use yourself, here's how to use it:
1.- Download the script from HERE.
2.- Review the code to make sure it doesn't do anything that could harm your computer or privacy! (ALWAYS do it when you download a script of any kind)
3.- Grant execution rights to the script following a method of your choice.
4.- Double-click on the script to execute.
PiConvert.shis obviously dependent on
imagemagick. The script will check for this dependency and error out if it is not met.