I have a series of png-images (actually they are taken from an mp4-file).
I want to crop the same region from all the images I have taken.
What tool is best for that, such that I can define the region first and then crop all the png images to the same region of interest.
Is there something to batch compress the resultant images (lossless)?
I tried apngasm, unfortunately the details to be shown in the series get optimized away - although apngasm is said to work lossless!
Since all the resultant images have great similarity: What is the best way to zip them to minimum size such that they can easily appended to an email such that the other person can look at them step by step to discuss the detail I want to show in them.
You could use
convert
from packageimagemagick
:Then you could wrap that command in a for loop, with file pattern matching, etc.
A more complete version of the given answer:
Take Gimp and use its function Crop to determine the area you want to keep. Select the area from the bottom right to the top left such that the coordinates of the upper left point and the width and height are displayed in Gimp's status bar.
In my example it said at the bottom
316,88, ...px... Rectangle 1622x634 ...
I then wrote a script and made it executable:
and that used this script which performed my cropping task.
I am still looking for an answer of a good compression taking into account that there are only small changes from one picture to the next one.
For doing image series in parallel (I would recommend only on SSD drive), install imagemagick and parallel (
sudo apt install imagemagick parallel
) and then try this:it uses 4 processes
-j 4
to convert file{}
intoout/{}
if file matches maskimg-*.png
mogrify from imagemagick package may work as well.
Regarding to similarity and compression, the most efficient is to use uncompressed images and compress them with something that does not compress individual files, but everything together. p7zip is usually the best and tar+bzip2 are sometimes/rarely better (usually for text and data like images that have very low contrast) tar+xz is very similar to p7zip (the same compression, different metadata). However for the most people zip is by far the most convenient format. For technical people using Windows 7zip is ok and I would advice using tar only if recepient is familiar with Linux.