Discussion:
Strip Vs Tile
Sonia S Kumar
2006-01-03 11:52:43 UTC
Permalink
Hi All,
My Query is regarding the layout of Tiff Images.
When to save a Tiff image as Tiled and when to save a Tiff image as
Strip ??
While saving, should we consider the layout of the original Tiff image
which we opened ??

Thanx & Regards,
Sonia
Pallek, Bernie: #CIPO - OPIC
2006-01-03 14:47:43 UTC
Permalink
Post by Sonia S Kumar
My Query is regarding the layout of Tiff Images.
When to save a Tiff image as Tiled and when to save
a Tiff image as Strip ??
While saving, should we consider the layout of the
original Tiff image which we opened ??
The TIFF spec 6.0 recommends a strip size of 8K (before compression). As far as deciding when to do multi-strip, you should consider your targets for the image data -- what platforms will deal with the images? If these platforms have limitations like the old real-mode Intel 64K segmentation, you'll probably want to do multi-strip for all images. If your images are going to be processed by flat-memory devices with reasonably fast storage media, multi-strip probably won't be useful until your images exceed 512K in size.

When saving data in general, IMO, you should try to preserve as much of the original "framing" as possible. In other words, preserve byte-ordering, stripping, compression format, IFD layout, whatever offsets you can, and even any custom tags that your software may not understand or care about. The TIFF format is very suited to this "preservation" idea. On the other hand, it really depends on your problem. Perhaps your goal is to "standardize" the format of your images...

_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Joris
2006-01-03 16:37:34 UTC
Permalink
Post by Pallek, Bernie: #CIPO - OPIC
Post by Sonia S Kumar
My Query is regarding the layout of Tiff Images.
When to save a Tiff image as Tiled and when to save
a Tiff image as Strip ??
While saving, should we consider the layout of the
original Tiff image which we opened ??
The TIFF spec 6.0 recommends a strip size of 8K (before compression).
That is mainly because the TIFF 6.0 spec was written when
- most of us were playing in a 64 kilobyte yard
- tiling was relatively new those days

IMO, what Bob said makes a lot more sense. If you don't need tiles, use
strips. Saving large images (say over 4 kilopixels wide and high), you
need tiles. I should add that for certain color spaces and compression
modes, like black and white G3 or G4 compressed, it is customary to save
a single strip even if the image is somewhat bigger then 4 kilopixels.

As to the strip/tile size, these days, I would almost recommend 8
megabyte rather then 8 kilobyte. We've recently learned on the list that
Photoshop's new strategy is to use as large a buffer as is affordable on
the machine in the run-time circumstances (though I'm not sure how
exactly 'affordable' is defined), because it helps getting the best
possible compression ratio and saves IO calls and fragmentation.
Post by Pallek, Bernie: #CIPO - OPIC
When saving data in general, IMO, you should try to preserve as much
of the original "framing" as possible. In other words, preserve
byte-ordering, stripping, compression format, IFD layout, whatever
offsets you can, and even any custom tags that your software may not
understand or care about.
That is bad advice. Don't ever blindly preserve. You may be preserving
data that is no longer valid after your operations.


Joris Van Damme
***@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Chris Cox
2006-01-04 18:57:35 UTC
Permalink
Post by Joris
IMO, what Bob said makes a lot more sense. If you don't need tiles, use
strips. Saving large images (say over 4 kilopixels wide and high), you
need tiles. I should add that for certain color spaces and compression
modes, like black and white G3 or G4 compressed, it is customary to save
a single strip even if the image is somewhat bigger then 4 kilopixels.
Note that for huge images, there will be more image coherency in 2D tiles
than in 1D strips -- so you may get better compression using tiles.
Post by Joris
As to the strip/tile size, these days, I would almost recommend 8
megabyte rather then 8 kilobyte.
I agree.
Post by Joris
We've recently learned on the list that
Photoshop's new strategy is to use as large a buffer as is affordable on
the machine in the run-time circumstances (though I'm not sure how
exactly 'affordable' is defined), because it helps getting the best
possible compression ratio and saves IO calls and fragmentation.
Unfortunately, "affordable" is a complex measure inside Photoshop based on
installed RAM, user memory settings, code size and OS overhead, locked image
tiles, OS paging activity (more paging == use less RAM for the app), etc.

And even though Photoshop uses planar tiles internally, we default to
interleaved strips in TIFF for greater compatibility (we offer the option of
planar data in CS2, but we have seen some applications choke on it and warn
the user about possible compatibility problems).

Chris

_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Andrey Kiselev
2006-01-04 20:14:15 UTC
Permalink
Post by Chris Cox
Post by Joris
As to the strip/tile size, these days, I would almost recommend 8
megabyte rather then 8 kilobyte.
I agree.
I just want to note that libtiff has two ways to specify the strip size:
with the --with-default-strip-size=SIZE option on UNIX systems and with
the STRIP_SIZE_DEFAULT nmake.opt option in Windows environment, and, of
course, with the TIFFTAG_ROWSPERSTRIP runtime setting.

Regards,
Andrey
--
Andrey V. Kiselev
ICQ# 26871517
_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Bob Friesenhahn
2006-01-03 16:09:22 UTC
Permalink
Post by Sonia S Kumar
Hi All,
My Query is regarding the layout of Tiff Images.
When to save a Tiff image as Tiled and when to save a Tiff image as
Strip ??
More software knows how to read stripped TIFF than tiled TIFF. Tiled
tiff is best for very large images where the reader/writer wants to
access a subset of the image. Since most software stores an image as
contiguous bytes in memory it is usually faster to read/write the
whole image if it is stripped TIFF. But if the strips are extremely
large there can be performance problems as well.

If there is no practical reason to save the image as tiles, then I
recommend using strips.
Post by Sonia S Kumar
While saving, should we consider the layout of the original Tiff image
which we opened ??
That depends on the intentions of your software.

Bob
======================================
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Pallek, Bernie: #CIPO - OPIC
2006-01-03 18:42:47 UTC
Permalink
J> IMO, what Bob said makes a lot more sense. If you don't need
Post by Joris
tiles, use
strips. Saving large images (say over 4 kilopixels wide and high), you
need tiles. I should add that for certain color spaces and compression
modes, like black and white G3 or G4 compressed, it is
customary to save
a single strip even if the image is somewhat bigger then 4 kilopixels.
Agreed. I misinterpreted the original question as asking when to bother with fragmentation at all (strips OR tiles).

J> B> When saving data in general, IMO, you should try to preserve as much
Post by Joris
Post by Pallek, Bernie: #CIPO - OPIC
of the original "framing" as possible. In other words, preserve
byte-ordering, stripping, compression format, IFD layout, whatever
offsets you can, and even any custom tags that your software may not
understand or care about.
That is bad advice. Don't ever blindly preserve. You may be preserving
data that is no longer valid after your operations.
OTOH, you may be losing data that are still valid (and meaningful) after your operations, and what's lost is gone. But the spec /does/ agree with your POV. :-)

_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Continue reading on narkive:
Loading...