meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:multimedia:images [2017/02/21 22:03] – created niziaklinux:multimedia:images [2024/02/27 10:07] (current) niziak
Line 1: Line 1:
 +====== Convert to JPG =====
 +
 +<code bash>mogrify -format jpg *.bmp</code>
 +
 +
 +====== Convert images to PDF =====
 +<code bash>convert pages_*.png final.pdf</code>
 +<code bash>convert pages_*.png -resize 50% -compress jpeg -quality 75 final.pdf</code>
 +
 +
 +====== merge PDFs ======
 +<code bash>pdfunite in-1.pdf in-2.pdf in-n.pdf out.pdf</code>
 +
 +====== Process PDF pages ======
 +<code bash>
 +convert -density 300 scanned.pdf output-%02d.png
 +
 +convert output*.png -normalize -threshold 80% normal.png
 +# or
 +convert output*.png +dither -colors 2 -colorspace Gray -normalize normal.png
 +# or
 +convert output*.png -monochrome normal.png # <-- this product nice dithered B&Wimage
 +
 +convert normal*.png final.pdf
 +</code>
 +
 +One liner:
 +<code bash>
 +convert -density 300 scanned.pdf -monochrome output.pdf
 +convert -density 300 scanned.pdf -normalize -threshold 70% output.pdf
 +</code>
 +
 +====== Rename images to EXIF date ======
 +
 +Use **krename** application.
 +
 +===== jhead =====
 +<code bash>
 +jhead -n%Y%m%d-%H%M%S *.jpg 
 +</code>
 +
 +===== exiv2 =====
 +exiv2 -k -r '%Y-%m-%d_%H-%M-%S_:basename:' rename "$i"
 +exiv2 -v -r '%Y%m%d.%H%M%S.:basename:' rename "$i"
 +
 +===== exiftool =====
 +<code bash>
 +exiftool -d %Y-%m-%d_%H-%M-%S%%-c.%%e "-filename<CreateDate" DIR 
 +If you want to keep track of original filename and write extension lower case:
 +
 +exiftool -d %Y%m%d_%H%M%S%%-c-%%f.%%le "-filename<DateTimeOriginal" [.|DIR]
 +The same works also with the whole filename in lowercase:
 +
 +exiftool -d %Y%m%d_%H%M%S%%-c-%%lf.%%le "-filename<DateTimeOriginal" [.|DIR]
 +</code>
 +
 +
 ====== Remove EXIF data ====== ====== Remove EXIF data ======
 <code bash> <code bash>