Breaking out large images from group 4 fax TIFF

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
Geoscientist

Breaking out large images from group 4 fax TIFF

Post by Geoscientist »

Hi,

I have a set of large TIFF images. They are typically less than 10Mb in size, but are encoded in group 4 fax format.
Once I have them saved us unencoded, uncompressed tif files, I can load them with GIMP and manipulate them prior to plotting them on a wide format plotter.
With these group 4 fax encoded images smaller than ~3Mb, I have successfully used "convert" to produce new manageable images. Above that size, the convert process consumes all of the available memory (~8Gb) and starts using the swap drive, and effectively stalls.

As an example, there is one image that is being particularly resilient to my efforts. The identify command returns "TIFF 4677x385208 4677x385208+0+0 1-bit Bilevel DirectClass 9.526mb 55.480u 4:19"
Thats not a misprint. It is a scanned log from a petroleum well. 11.7" wide by 963" long. In this case, there are two main logs, and two repeated sections, joined one after another. Once I have the image in GIMP, I crop each of these sections into seperate images for further processing, vectorisation or plotting.

Can anybody suggest some commands I can use to rewrite this image to a friendlier format (such as uncompressed tif)?
I am using Ubuntu64 (Release 9.04), 4 x 2.4GHz, 7.7Gb RAM.

Thankyou.
jaffamuffin
Posts: 59
Joined: 2009-01-30T03:46:08-07:00

Re: Breaking out large images from group 4 fax TIFF

Post by jaffamuffin »

I make that about 214 GB uncompressed at 1bpp..... That's quite large. Why would you want to use uncompressed TIF? TIF G4 is a good standard for bi-tonal images.

As for manipulating such a beast, I know there are programs which can work on massive images b only loading a small part into memory, but I forget the name, they tend to be quite specialised.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Breaking out large images from group 4 fax TIFF

Post by fmw42 »

Geoscientist

Re: Breaking out large images from group 4 fax TIFF

Post by Geoscientist »

That was a very relevant link!

I will try using "stream" to cut up the image, but I couldn't figure out how to declare the format of the output.
Can I take a group 4 fax encoded tif image, and stream it to another image without that encoding.
I cant get my head around the example;
stream -map rgb -storage-type char -extract 100x100+200+100 logo: - |\
convert -depth 8 -size 100x100 rgb:- stream_wand.gif

I gather stream_wand.gif is the output. Is logo: the source image?
I can specify the area of the source image to be extracted (area and offsets).
Is that a single line of code thats been divided over two lines, or is it two lines of code?

This massive image was created with some Windows software called Imagenation. I opted to use an evaluation copy, and that loads the image in about 2 seconds, and I rescaled it down to 200dpi (from 400dpi), cropped out each of the image sections and saved it with a non-CCITT compression (Packbits or LZW). Of course, the output is watermarked because it is an evaluation version.

Thankyou.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Breaking out large images from group 4 fax TIFF

Post by fmw42 »

logo: is a (640x48) special internal IM image (one of only a few and requires the colon) see
http://www.imagemagick.org/script/forma ... tin-images

It is the input image.

The |\

is a pipe and then a line continuation in Unix. So two commands that have been piped together.

For windows, see http://www.imagemagick.org/Usage/windows/

The input on the next section that is being piped to is rgb:-

see
http://www.imagemagick.org/Usage/basics/
http://www.imagemagick.org/Usage/files/



Sorry I cannot help any more. I have never used any massive image processing tricks like that or tuned my IM configuration to do so. Perhaps you will get a reply from Anthony or Magick who know more about these things.
Post Reply