Category Archives: Useful tools

Imagemagick for batch processing of images

Imagemagick can apply a number of different filters at a time. In combination with the linux pipes it is possible to batch process a huge number of images.

The command below takes all images in the “data” directory and does the following steps:

  • Resize to 400×300 pixels
  • Transform to gray color
  • Apply a sepia effect to give the image an “old” style
  • Change (brightness,saturation,hue) from (100,100,100) to (100.35,100)

ls data/ | xargs -I {} convert data/{} -resize 400×300 -colorspace gray -sepia-tone 81% -modulate 100,35,100 -quality 60 {}.jpg

Show progress of “dd” process

The “dd” tool is very useful for cloning/backing up/erasing partitions and harddrives. However all these tasks take a long time and the “dd” command does not output status messages on the screen. You never know how much time the process will need to complete or how much data has already been processed.

Luckily there is a hidden way to get this information. Get a command prompt and enter the command below. Replace “Process-Id” by the id of the “dd” process, which can be obtained by “ps -A”.

kill -SIGUSR1 Process-Id