Return-Path: <tiff-bounces@lists.maptools.org>
Received: from mailgate108.isp.belgacom.be (mailgate108.isp.belgacom.be [195.238.6.89])
        by inmx018.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id l5IFCb9f006659
        for <joris.at.lebbeke@skynet.be>; Mon, 18 Jun 2007 17:12:39 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 18 Jun 2007 17:12:36 +0200
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l5IF0KRp008472;
	Mon, 18 Jun 2007 11:01:15 -0400
Received: from scooby.simplesystems.org (scooby.simplesystems.org
	[65.66.246.67])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l5IF0HNP008469
	for <tiff@lists.maptools.org>; Mon, 18 Jun 2007 11:00:17 -0400
Received: from blade.simplesystems.org (blade.simplesystems.org [65.66.246.74])
	by scooby.simplesystems.org (8.12.10+Sun/8.12.10) with ESMTP id
	l5IF09jI013247; Mon, 18 Jun 2007 10:00:09 -0500 (CDT)
Date: Mon, 18 Jun 2007 10:00:09 -0500 (CDT)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@blade.simplesystems.org
To: Full Midnight <full.midnight@gmail.com>
Subject: Re: [Tiff] Converting from Striped TIFF into Tiled TIFF
In-Reply-To: <750ac2800706180339o37a3e193heaafd35915a07005@mail.gmail.com>
Message-ID: <Pine.SOC.4.60.0706180954010.24018@blade.simplesystems.org>
References: <750ac2800706170700n1b4dd6a1k9c0f3cc27a41946a@mail.gmail.com> 
	<Pine.SOC.4.60.0706171058450.24018@blade.simplesystems.org>
	<750ac2800706180339o37a3e193heaafd35915a07005@mail.gmail.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: Tiff List <tiff@lists.maptools.org>
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00002432
X-MSP-STORE: Mon, 18 Jun 2007 17:13:13 +0200
Status: RO

When I attempt to load your striped.tiff file, I see this error 
message from libtiff:

   "Compression algorithm does not support random access."

so it seems that libtiff itself does not want to read this file. 
There must be some limitation related to the PackBits compression.

The tiffcp from recent libtiff reports:

% tiffcp -t -w 256 -l 256 -p separate striped.tiff tiled.tiff
striped.tiff: Compression algorithm does not support random access.
striped.tiff: Error, can't read scanline 1.

Bob

On Mon, 18 Jun 2007, Full Midnight wrote:

> Hello Bob,
>
> Thank you for your quick reply! :)
> The output tiff should be also in CMYK, as the input file. And planar +
> tiled, yes! :)
>
> Given the Input file below:
> -------
> tiffinfo -s -z striped.tiff
> TIFF Directory at offset 0x564144
> Image Width: 1600 Image Length: 1200
> Resolution: 119.99, 119.99 pixels/inch
> Bits/Sample: 8
> Compression Scheme: PackBits
> Photometric Interpretation: separated
> Ink Set: CMYK
> Samples/Pixel: 4
> Rows/Strip: (infinite)
> Planar Configuration: separate image planes
> 4 Strips:
>     0: [       8,  1396041]
>     1: [ 1396049,  1419801]
>     2: [ 2815850,  1414917]
>     3: [ 4230767,  1422036]
> -------
>
> ..., after converting it using tiffcp:
>
> -------
> tiffcp -t -w 256 -l 256 -p separate striped.tiff tiled.tiff && tiffinfo -s
> -z tiled.tiff && ls -al tiled.tiff && ls -al striped.tiff
> striped.tiff: Warning, using top-left orientation.
> striped.tiff: Compression algorithm does not support random access.
> TIFF Directory at offset 0x241f2
> Image Width: 1600 Image Length: 1200
> Tile Width: 256 Tile Length: 256
> Resolution: 119.99, 119.99 pixels/inch
> Bits/Sample: 8
> Compression Scheme: PackBits
> Photometric Interpretation: separated
> Ink Set: CMYK
> Orientation: row 0 top, col 0 lhs
> Samples/Pixel: 4
> Planar Configuration: separate image planes
> 140 Tiles:
>     0: [       8,     1167]
>     1: [    4676,     1184]
>     2: [    9408,     1172]
>     3: [   14080,     1187]
>     4: [   18836,     1193]
>     5: [   23606,     1205]
>     6: [   28426,     1210]
>     7: [   33266,     1024]
>     8: [   37362,     1024]
>     9: [   41458,     1024]
>    10: [   45554,     1024]
>    11: [   49650,     1024]
>    12: [   53746,     1024]
>    13: [   57842,     1024]
>    14: [   61938,     1024]
>    15: [   66034,     1024]
>    16: [   70130,     1024]
>    17: [   74226,     1024]
>    18: [   78322,     1024]
>    19: [   82418,     1024]
>    20: [   86514,     1024]
>    21: [   90610,     1024]
>    22: [   94706,     1024]
>    23: [   98802,     1024]
>    24: [  102898,     1024]
>    25: [  106994,     1024]
>    26: [  111090,     1024]
>    27: [  115186,     1024]
>    28: [  119282,     1024]
>    29: [  123378,     1024]
>    30: [  127474,     1024]
>    31: [  131570,     1024]
>    32: [  135666,     1024]
>    33: [  139762,     1024]
>    34: [  143858,     1024]
>    35: [    1175,     1167]
>    36: [    5860,     1184]
>    37: [   10580,     1168]
>    38: [   15267,     1187]
>    39: [   20029,     1191]
>    40: [   24811,     1205]
>    41: [   29636,     1210]
>    42: [   34290,     1024]
>    43: [   38386,     1024]
>    44: [   42482,     1024]
>    45: [   46578,     1024]
>    46: [   50674,     1024]
>    47: [   54770,     1024]
>    48: [   58866,     1024]
>    49: [   62962,     1024]
>    50: [   67058,     1024]
>    51: [   71154,     1024]
>    52: [   75250,     1024]
>    53: [   79346,     1024]
>    54: [   83442,     1024]
>    55: [   87538,     1024]
>    56: [   91634,     1024]
>    57: [   95730,     1024]
>    58: [   99826,     1024]
>    59: [  103922,     1024]
>    60: [  108018,     1024]
>    61: [  112114,     1024]
>    62: [  116210,     1024]
>    63: [  120306,     1024]
>    64: [  124402,     1024]
>    65: [  128498,     1024]
>    66: [  132594,     1024]
>    67: [  136690,     1024]
>    68: [  140786,     1024]
>    69: [  144882,     1024]
>    70: [    2342,     1167]
>    71: [    7044,     1182]
>    72: [   11748,     1166]
>    73: [   16454,     1191]
>    74: [   21220,     1193]
>    75: [   26016,     1205]
>    76: [   30846,     1210]
>    77: [   35314,     1024]
>    78: [   39410,     1024]
>    79: [   43506,     1024]
>    80: [   47602,     1024]
>    81: [   51698,     1024]
>    82: [   55794,     1024]
>    83: [   59890,     1024]
>    84: [   63986,     1024]
>    85: [   68082,     1024]
>    86: [   72178,     1024]
>    87: [   76274,     1024]
>    88: [   80370,     1024]
>    89: [   84466,     1024]
>    90: [   88562,     1024]
>    91: [   92658,     1024]
>    92: [   96754,     1024]
>    93: [  100850,     1024]
>    94: [  104946,     1024]
>    95: [  109042,     1024]
>    96: [  113138,     1024]
>    97: [  117234,     1024]
>    98: [  121330,     1024]
>    99: [  125426,     1024]
>   100: [  129522,     1024]
>   101: [  133618,     1024]
>   102: [  137714,     1024]
>   103: [  141810,     1024]
>   104: [  145906,     1024]
>   105: [    3509,     1167]
>   106: [    8226,     1182]
>   107: [   12914,     1166]
>   108: [   17645,     1191]
>   109: [   22413,     1193]
>   110: [   27221,     1205]
>   111: [   32056,     1210]
>   112: [   36338,     1024]
>   113: [   40434,     1024]
>   114: [   44530,     1024]
>   115: [   48626,     1024]
>   116: [   52722,     1024]
>   117: [   56818,     1024]
>   118: [   60914,     1024]
>   119: [   65010,     1024]
>   120: [   69106,     1024]
>   121: [   73202,     1024]
>   122: [   77298,     1024]
>   123: [   81394,     1024]
>   124: [   85490,     1024]
>   125: [   89586,     1024]
>   126: [   93682,     1024]
>   127: [   97778,     1024]
>   128: [  101874,     1024]
>   129: [  105970,     1024]
>   130: [  110066,     1024]
>   131: [  114162,     1024]
>   132: [  118258,     1024]
>   133: [  122354,     1024]
>   134: [  126450,     1024]
>   135: [  130546,     1024]
>   136: [  134642,     1024]
>   137: [  138738,     1024]
>   138: [  142834,     1024]
>   139: [  146930,     1024]
> -rw-rw-r--  1 xx xx 149296 Jun 18 11:57 tiled.tiff
> -rw-rw-r--  1 xx xx 5653034 Jun 18 10:44 striped.tiff
> -------
>
> It seems that the tiled image size is only 150k instead of 5.6MB.. so
> something is wrong..
> I've also tried with "-p contig", and the size of tiled.tiff is still below
> 200k.
> Just in case, I have uploaded the tiled.tiff and stripped.tiff here:
> ---
> http://rapidshare.com/files/37890126/tiled.tiff.html
> http://rapidshare.com/files/37889942/striped.tiff.html
> ---
> Note that in order to view the stripped tiff, you need an image viewer which
> is capable of viewing separate planes (I use CinePaint, but I've heard that
> Photoshop reads it, too). Gimp doesn't seem to like it ("Unsupported layout.
> No RGBA loader").
>
> On another side, does anyone know how could I use libtiff in order to do
> this? (i.e. the "logic")
>
> Thank you very much,
> Marius.
>
> On 6/17/07, Bob Friesenhahn <bfriesen@simple.dallas.tx.us> wrote:
>> 
>> On Sun, 17 Jun 2007, Full Midnight wrote:
>> 
>> > Hello,
>> >
>> > Let me please explain what I am trying to accomplish:
>> >
>> > As Input, we have a Striped TIFF (Photometric Interpretation: separated
>> and
>> > Planar Configuration: separate image planes, where each strip below
>> > represents one plane of the CMYK) with the following characteristics:
>> >
>> > And what we would like to achieve is a tiled TIFF using the above input
>> > TIFF.
>> >
>> > Can someone please tell me if the libtiff (or any of its tools) are
>> capable
>> > of doing this type of "conversion"? And if so, using which call/tool?
>> 
>> While I know that development GraphicsMagick 1.2 can deal with your
>> file, have you tried libtiff's 'tiffcp' program?  It is intended for
>> these tasks.  Since your image is fairly large, make sure that your
>> system has plenty of RAM available.
>> 
>> Do you want the output file to be RGBA tiled only (consecutive
>> samples), or planar+tiled?
>> 
>> Bob
>> ======================================
>> Bob Friesenhahn
>> bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
>> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
>> 
>> 
>

======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
