Huge RAM usage on small files [TIF->PDF

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
babul
Posts: 2
Joined: 2018-08-22T23:54:19-07:00
Authentication code: 1152

Huge RAM usage on small files [TIF->PDF

Post by babul »

Hey,

I'm having a problem of converting multiple TIF files into a single PDF. The files were produced in Scantailor, they are about 200 kB on average, but their resolution is huge (9032 x 13476). There's about 50 of them and it's monochrome text only. I'm running Arch Linux and ImageMagick 7.0.8-10.

I guess that the program tries to convert them somehow like they would be full color or something, and I'm running into out of memory/cache problems. Not to mention it takes way too long to convert even single page. I just want to merge the files into PDF without any compression. I tried "-compress None" and "Group4" (that's what I use on Windows), also tried suggestion from this thread: viewtopic.php?t=32431 (-monochrome -type bilevel). Is it possible or will I be forced to launch Windows just to make a PDF from those files? No matter what I do, my ram and cache fills almost instantly. I tried tiff2pdf, but that doesn't support multiple files (and merging those with imagemagick isn't possible due to memory problem). Doing such things in Windows using Irfanview multipage tiff -> pdf was always a matter of seconds.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Huge RAM usage on small files [TIF->PDF

Post by snibgo »

IM is a general-purpose raster image processor. It reads all the images into memory before doing any processing, which is overkill for your needs.

I suggest you convert each tiff to pdf using tiff2pdf or IM, then use pdfunite on all the pdf files.
snibgo's IM pages: im.snibgo.com
babul
Posts: 2
Joined: 2018-08-22T23:54:19-07:00
Authentication code: 1152

Re: Huge RAM usage on small files [TIF->PDF

Post by babul »

Thank you for clarifying, going to try it the way you suggested. I probably should've known it's not designed to this specific task, so sorry about that.
Post Reply