Next, different solutions for various problems that are presented to us daily and this time, they teach us how to resize images through the terminal using two tools that belong to the package Imagemagick.
As they tell us in the original article:
In the first instance both have similarities, although mogrify transforms the image by replacing the original file while convert save the result in a new file. TO mogrify only the image to be transformed is passed as an argument, while convert, the image we want to transform and the name of the file where the result will be saved.
Convert
Let's first see how to do various tasks with convert:
Cut an image in half and save the result to file file2.jpg:
$ convert -resize 50%
file
.jpg file2.jpg
Resize the image file.jpg to 400 × 300 and save the result in the file file2.jpg:
$ convert -resize 400×300 file.jpg file2.jpg
Halve all photos and save the result in other files:
$ convert -resize 50% *
mogrify
Cut the image file.jpg in half:
mogrify -resize 50% file.jpg
Resize the image file.jpg to 400 × 300:
mogrify -resize 400×300 file.jpg
Halve all photos:
mogrify -resize 50% *
It's very good, but the problem with all this is that it is practically impossible to remember all the commands of many applications per console, in the end you only have two or three applications.
That's what passes for being a wreck, Alzheimer's is on the prowl
hahaha, it seems negative but since the "new age" is right !!
Maybe :), at least I'll forget about the shit that this world is xd
Uff, another emo ... LOL !!
I'm not emo, realistic llama, The only good thing in life is eating, drinking, playing video games and fucking LOL (if it can be with a Japanese girl better LOL).
That's what I'm trying to explain to Sandy, the world is shit right now, there are only bad people who rob you around the corner, there is no work, they all take part in the fun, etc.
But even if we say this to Sandy, he will continue to call us emos, even if we don't iron our hair, don't cut ourselves and don't listen to My Chemical Romance
WHAT IF THE WORLD PAES AND DOESN'T Kind to the commands! hehehe I sweat it hehehe
That's what Thunar's custom actions are for! 😀
"It is practically impossible to remember all the commands of many applications per console"
It's not impossible, if you don't want to battle with them you can always make a few aliases in your .bashrc. Or a bash script that makes the process easier.
Greetings.
Long live aliases, they make life much easier. Although mine is extreme, I make aliases to apt-get ee
An important detail is that if one establishes a square proportion, convert maintains the correct proportion, but gives the long side the dimension we have set. We can also set the quality level, and many other things can be done.
convert -resize 1024x1024 -quality 85 miarchivo1.jpg miarchivo2.jpg
Very good, I had seen it sometime but I had already forgotten it. 🙂