2007.07.12 15:21 "[Tiff] how to rotate an image", by Oliver Geisen

2007.07.13 16:19 "[Tiff] Re: Bit shifting and rotating of TIFF images", by Richard Nolde

Oliver,
   Concerning rotating TIFF images and compositing them onto a
background image. Check out the CVS release and find the new utility
tiffcrop in the utils directory. I am working on an update to the
currently available version but the code to rotate images should work
for you. Note that rotations of 90 or 270 degrees may change the size of
the buffer due to the handling of the padding bytes at the end of each
scanline.

 The code to crop margins, selections, and regions will be useful in
compositing images as well as it computes the offsets into the image
that you need and then extracts the right bits, shifting as needed, when
it copies the data from the input buffer to the output buffer.
Compositing instead of extracting will just be a matter of computing the
offsets into the target buffer and using the same basic logic with the
additional overhead of handling the merging of adjacent edges if the
two images are to be meshed seamlessly.

 Tiffcrop is based on tiffcp with the additional code needed to modify
the image data itself. There are additional options to mirror the image
horizontally and vertically and rotate by 90 and 270 degrees as well.
The currently available code performs the area extractions before
rotations which I think I will change to rotate before extract or
possibly offer an option an option to specify the ordering.

On a 8 processor IBM P570 with 32 GB of memory and 600+ active users it took under 30 seconds real time to rotate 50 pages of mixed letter and legal paper size at 300x300 dpi in G4 compressed strips with a file size of about 38 MB. The same file took just over 11 seconds on an 850 MHz PIII single processor Linux box with 512 MB of memory running Fedora 5. Rotating by 90 or 270 degrees takes just under 15 seconds on the same machine.

If you can't find it in the CVS tree, let me know and I'll send it to you directly.

Richard Nolde

how can i rotate an tiff image by 180 degrees (from head-up to head- down)?

For now i use Strip-reading bottom-up and scanline writing top-down. The problem is that i also have to swob all bits of each scanline horizontaly (byte and bit swob) and don't know how to handle this effectivly.

Any ideas about that?

> as about that?
>
>
>