Monday, June 13, 2016

Resize image on GNU/Linux using  imagemagick

What is  imagemagick ?

ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

Use this command to resize *.JPG file and image will be resize 30% from original image and will be rename the file using add the 'Pondok_Ramadhan' on front of every file.


$for i in $( ls *.JPG); do convert -resize 30% $i Pondok_Ramadhan_$i; done

before :
[fatur@majoris Perpus Sekolah]$ du -hs *
4.3M    MFR_2164.JPG
4.3M    MFR_2165.JPG
3.7M    MFR_2166.JPG
3.6M    MFR_2167.JPG
3.6M    MFR_2168.JPG
4.1M    MFR_2169.JPG
4.2M    MFR_2172.JPG







After resize :
 [fatur@majoris Perpus Sekolah]$ du -hs *
536K    Pondok_Ramadhan_MFR_2164.JPG
552K    Pondok_Ramadhan_MFR_2165.JPG
464K    Pondok_Ramadhan_MFR_2166.JPG
468K    Pondok_Ramadhan_MFR_2167.JPG
472K    Pondok_Ramadhan_MFR_2168.JPG
536K    Pondok_Ramadhan_MFR_2169.JPG
448K    Pondok_Ramadhan_MFR_2172.JPG
[fatur@majoris Perpus Sekolah]$

No comments: