I have many pictures which size differ much from picture to picture.
I aim to develop an algorithm which allows you to remove the extra whitespace. Such algorithms are used in Signal Processing in removing the redundant noise, for instance in mobile phones.
The algorithm should be used as follows
\includegraphics[crop-redundant-whitespace]{picture.png}
The function crop-redundant-whitespace
should change the include -command, for instance to
\includegraphics[width=2.5cm, height=5.0cm]{picture.png}
The algorithm should
- detect parts of size at least 2cm in length which are separate from each other
- if many large parts exist, then the biggest part should be selected.
How can you automatically resize pictures and make them fix to A4?