This can be done from terminal. How to Quickly Resize, Convert & Modify Images from the Linux Terminal:
ImageMagick will try to preserve the aspect ratio if you use this
command. It will alter the image to fit within a 200×100 area, but the
image may not be exactly 200×100. If you want to force the image to
become a specific size – even if it messes up the aspect ratio – add
an exclamation point to the dimensions:
convert example.png -resize 200×100! example.png
You can also use GIMP.
GIMP is expandable and extensible. It is designed to be augmented with
plug-ins and extensions to do just about anything. The advanced
scripting interface allows everything from the simplest task to the
most complex image manipulation procedures to be easily scripted.
Source: http://docs.gimp.org/en/introduction.html
To install GIMP, you can run
sudo apt-get install gimp
Yes, such a program exists!
ImageMagick has the compare
utility, which has several ways of comparing images.
To install it:
sudo apt-get install imagemagick imagemagick-doc
Comparing two images visually:
compare -compose src tux_orig.png tux_modified.png tux_difference.png
tux_orig.png
& tux_modified.png
Gives this image:
Comparing two images via metrics:
There are also many ways to output the differences via some metrics, e.g.:
# compare -verbose -metric PSNR tux_orig.png tux_modified.png tux_difference.png
tux_orig.png PNG 200x232 200x232+0+0 8-bit sRGB 20.6KB 0.000u 0:00.000
tux_modified.png PNG 200x232 200x232+0+0 8-bit sRGB 22.2KB 0.010u 0:00.000
Image: tux_orig.png
Channel distortion: PSNR
red: 19.5485
green: 19.5973
blue: 19.6507
alpha: 16.1568
all: 18.4517
tux_orig.png=>tux_difference.png PNG 200x232 200x232+0+0 8-bit sRGB 12.3KB 0.030u 0:00.020
Some metric options:
AE absolute error count, number of different pixels (-fuzz effected)
FUZZ mean color distance
MAE mean absolute error (normalized), average channel error distance
MEPP mean error per pixel (normalized mean error, normalized peak error)
MSE mean error squared, average of the channel error squared
NCC normalized cross correlation
PAE peak absolute (normalize peak absolute)
PSNR peak signal to noise ratio
RMSE root mean squared (normalized root mean squared)
There are many ways to compare images, see ImageMagicks section on compare for further methods.
Best Answer
The imagemagick package includes a
convert
command.Example commands:
Both are simple versions of removing a background and might make all other none-background white in the image transparent (the fuzzy/threshold options can adjust that).
But Imagemagick has examples on removing backgrounds using masks.
What works best depends on the original. JPG tend to be fuzzy (what looks like the same color often are slightly different colors) so they will have mixed results.