Bulk conversion of graphics files  [Solved]

Any MX member can start threads and post in this section. Feel free to express your views, make requests, offer support, give ideas - basically anything to do with MX art. Art usually is an "in the eye of the beholder" thing - so please respect everyone's right to their own personal taste!
Post Reply
Message
Author
User avatar
Gordon Cooper
Posts: 965
Joined: Mon Nov 21, 2011 5:50 pm

Bulk conversion of graphics files

#1 Post by Gordon Cooper »

Has anyone found/seen anything providing bulk conversion of jpeg files to pdf? I am working on a project (two of us) recovering pages from an NZ
amateur radio magazine into a digital archive. So far about 30,000 page files. I am working with Gimp in MX but my colleague is a long time Windows man. I am handling the final collation and saving in a Cloud store, for future readers.

My problem is the conversion of a thousand (or more) jpeg files to the pdf format. This is easy one file at a time, but slow and laborious. Years ago when I used Windows, I wrote a script in Pascal, to work through a folder and do the conversion. That program will not run in linux, and I'm getting a bit old and doddery to write something in Free Pascal to do the job. Hence my request.

Any suggestions ?

Thanks,
Gordon.
Backup: Dell9010, MX-19_B2, Win7, 120 SSD, WD 232GIB HD, 4GB RAM
Primary :Homebrew64 bit Intel duo core 2 GB RAM, 120 GB Kingston SSD, Seagate1TB.
MX-18.2 64bit. Also MX17, Kubuntu14.04 & Puppy 6.3.

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Bulk conversion of graphics files

#2 Post by JayM »

ffmpeg could probably do it from within a shell script. Strike that, use convert instead. https://duckduckgo.com/?q=batch+convert ... 1-1&ia=web
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

Geek3579
Posts: 44
Joined: Sat Aug 22, 2020 2:21 am

Re: Bulk conversion of graphics files

#3 Post by Geek3579 »

I believe Imagemagick is installed in the latest MX-Linux OS.

You can convert all JPG images in a directory to one PDF document via the following bash one-liner if the terminal is opened in that directory: convert "*.(JPG)" -quality 150 FileOUT.PDF
(for better quality, use -quality 600)

If you wish to save the PDFs as single files, a small FOR-Done loop is required

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Bulk conversion of graphics files

#4 Post by JayM »

I missed the bit where you wanted to convert them to pdfs. A websearch is your friend as your question isn't specific to MX Linux but applies to any distro: https://duckduckgo.com/?q=batch+convert ... 1-1&ia=web
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

leekz-my
Posts: 13
Joined: Fri Apr 02, 2021 11:12 am

Re: Bulk conversion of graphics files

#5 Post by leekz-my »

I've seen people using command:

Code: Select all

img2pdf
AFAIK it's slightly better than imagemagick for loseless conversion.

If it ain't broke, don't fix it. 9_9

User avatar
Stevo
Developer
Posts: 12838
Joined: Fri Dec 15, 2006 8:07 pm

Re: Bulk conversion of graphics files

#6 Post by Stevo »

If you prefer a GUI for imagemagick batch conversion, converseen should fill the bill.

Code: Select all

Package: converseen
Version: 0.9.7.2-1
Priority: optional
Section: graphics
Maintainer: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Installed-Size: 1,121 kB
Depends: libc6 (>= 2.14), libgcc1 (>= 1:3.0), libmagick++-6.q16-8, libmagickcore-6.q16-6 (>= 8:6.9.10.2), libqt5core5a (>= 5.11.0~rc1), libqt5gui5 (>= 5.8.0), libqt5network5 (>= 5.0.2), libqt5widgets5 (>= 5.11.0~rc1), libstdc++6 (>= 5.2)
Homepage: https://converseen.sourceforge.net/
Tag: uitoolkit::qt
Download-Size: 284 kB
APT-Manual-Installed: yes
APT-Sources: http://deb.debian.org/debian buster/main amd64 Packages
Description: batch image converter and resizer
 You can convert an unlimited number of images and / or create thumbnails
 to any of the most popular formats: DPX, EXR, GIF, JPEG, JPEG-2000, PDF,
 PhotoCD, PNG, Postscript, SVG, and TIFF.
 .
 Thanks to the Magick++ image libraries it supports more than 100 image
 formats.


User avatar
Gordon Cooper
Posts: 965
Joined: Mon Nov 21, 2011 5:50 pm

Re: Bulk conversion of graphics files  [Solved]

#7 Post by Gordon Cooper »

Many thanks for the replies. Will work on it today.
Backup: Dell9010, MX-19_B2, Win7, 120 SSD, WD 232GIB HD, 4GB RAM
Primary :Homebrew64 bit Intel duo core 2 GB RAM, 120 GB Kingston SSD, Seagate1TB.
MX-18.2 64bit. Also MX17, Kubuntu14.04 & Puppy 6.3.

Geek3579
Posts: 44
Joined: Sat Aug 22, 2020 2:21 am

Re: Bulk conversion of graphics files

#8 Post by Geek3579 »

Sorry Gordon, I checked in better light and found that I had misread my notes:
The batch conversion using ImageMagick should have used CURLY Brackets: convert "*.{JPG}" -quality 150 FileOUT.PDF

But while I'm on the topic of ImageMagick I will also add that you can combine a batch of individual PDF's into one: convert -density 150 *.PDF Output.PDF

Converseen ??? Gee, I must check that out !!

Post Reply

Return to “Art Discussion”