Page 1 of 1

NConvert - help with file compression [Solved]

Posted: Mon Apr 28, 2025 2:48 pm
by Glazza
Hi

Firstly, apologies if there's not the right info here as I'm a relative novice when it comes to Nconvert, but I'm hoping someone can help me with this as I've tried everything I've read (or that ChatGPT has suggested) and I'm going round in circles.

Basically, I have a large number of single page tifs which I need to convert to multi-page using nconvert, but whatever variation of compression I use, I get a significantly increased filesize when I run the command.

An example of one of my input TIFs is:-

C:\NConvert\Input\000ID001.TIF : Success
Format : TIFF
Name : tiff
Compression : CCITT Group 4
Width : 2480
Height : 3504
Components per pixel : 1
Bits per component : 1
Depth : 1
# colors : 2
Color model : RGB
Bytes Per Plane : 310
Orientation : Top Left
Xdpi : 300
Ydpi : 300
Page(s) : 1
Info:
Photometric Interpretation: White=0
Software: Pixel Translations Inc., PIXTIFF Version 55.0.218.726
Metadata : ( EXIF )

In this particular example, I'm trying to merge 60 single page TIFs of the same format using variations of this command...

Code: Select all

NConvert.exe -out tiff -o C:\NConvert\Output\filename.tif -multi -c 2 -colors 64 -dither C:\NConvert\Input\*
but I have tried many variations of the compression (LZW, cci4, floyd from memory) and I always seem to get the same result.

My input files (60 single page tifs) are about 3.1MB but the output file is 17MB. The files appear to have been created by a very old scanning program from about 15 years ago and are all black and white

If anyone has any helpful suggestions, it would be appreciated.

Re: NConvert - help with file compression

Posted: Mon Apr 28, 2025 3:49 pm
by cday
Not sure about one or two terms in your code but can't check at the moment, would you be able to convert one file and post the source and the output files? I mean a single image, or if that would require modifying your code maybe a two-image TIFF conversion.

Edit:

Code: Select all

 -c value          : Compression number
              default : 0 (uncompressed)
              PDF    : 1 (Fax), 2 (Rle), 3 (LZW), 4(ZIP), 5 (JPEG)
              TIFF   : 1 (Rle), 2 (LZW), 3 (LZW+Prediction)
                       4 (ZLIB)
                       5 (CCITT G3), 6 (CCITT G3-2D), 7 (CCITT G4) only B/W
                       8 (JPEG) only 24/32 bits
Why -c 2 rather than -c 7 for CCITT G4 output which in most cases normally works well, although from the terminal output you do seem to be creating a CCITT G4 file, if the image data is for the output rather than source file?

And why -colors 64 and -dither which seem inappropriate?

Re: NConvert - help with file compression

Posted: Tue Apr 29, 2025 6:56 am
by Glazza
This ( -c7) sorted my problem immediately so many thanks for the reply! See... I told you I didn't know what I was doing 😉