I want to join two image files in Ubuntu 12.04. Is there any way I can accomplish this?
Is there any utility for joining image files, perhaps something like MS-Paint in Ubuntu?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityI want to join two image files in Ubuntu 12.04. Is there any way I can accomplish this?
Is there any utility for joining image files, perhaps something like MS-Paint in Ubuntu?
As a complement to the other answer on imagemagick
and considering the need for a GUI.
Inspired by this post saying that ImageMagick has command line tool named convert
to merge images. To join images horizontally (in alphabetical order):
convert +append *.png out.png
To stack images vertically:
convert -append *.png out.png
That should be run in a terminal into the folder containing png files to join them all.
A GUI for that would be:
An easy way when it comes to that is Thunar's custom actions:
To join selected images vertically (into one png
file, in alphabetical order, no matter their extension) add this custom action ('Edit - Configure custom actions'):
convert -append %F joined-vertical.png
To join horizontally:
convert +append %F joined-horizontal.png
The same commands can be used in a .desktop
file in /.local/share/file-manager/actions
which adds a context menu for Nautilus and/or PCManFM.
Example for vertical join:
[Desktop Entry]
Type=Action
Name=Join images (vertically)
Profiles=profile-zero;
TargetLocation=true
Icon=gthumb
[X-Action-Profile profile-zero]
Basenames=image/*;*;
Exec=convert -append %F joined-image.png
Name[en_US]=Default profile
Name[en]=Default profile
Name[C]=Default profile
"join two images" is a quite vague description, but I'm sure you can do what you want with Gimp. You can install it using Software Center or from the command line using
sudo apt-get install gimp
It is probably closer in functionality of Photoshop than to MSPaint though... which is a good thing.
Here's how to do it in GIMP:
That's it! Instead of GIMP you can use Pinta
You can use imagemagick
to do this. (I am using it as well.)
First install it: sudo apt-get install imagemagick
After that look here for usage, you will find a lot of examples. The best is that you can use it from command line (integrate within a script for example).
For anyone that doesn't have the luxury of installing software(ex. on a work computer)...
If it hasn't been removed, libreoffice Draw can also do this if your preference is manual manipulation...(with me guessing what "join" truly means)
You open both instances
cut one image
paste it to the other (or both into new file)
arrange them to preference (postiton/crop/etc)
select the entire new image
right click and convert it to a bitmap or metafile
right-click and save
choose your format
Two images side by side:
convert image1.png image2.png +append joined_horizontal.png
Two images one above the other:
convert image1.png image2.png -append joined_vertical.png
Use -resize
if the images don't have the same width/height
You can fix the height for all of them with the -resize
option, e.g. to fix a 500 pixel height on two images joined horizontally:
convert +append image_1.png image_2.png -resize x500 new_image_conbined.png
Or for vertical joins, you would want to set a fixed width instead:
convert -append image_1.png image_2.png -resize 500x new_image_conbined.png
Example:
image_1.png 1067x600
image_2.png 1920x1080
new_image_conbined.png 889x500
Related:
How to do it interactively with GIMP
If you need to crop/resize images interactively first, which is often the case, then GIMP is the perfect tool for it, here's a detailed step-by-step: https://graphicdesign.stackexchange.com/questions/83446/gimp-how-to-combine-two-images-side-by-side/145543#145543
SVGs
ImageMagick 6.9.11-60 doesn't handle them, so see: