| 1 |
raw2tiff |
| 2 |
======== |
| 3 |
|
| 4 |
.. program:: raw2tiff |
| 5 |
|
| 6 |
|
| 7 |
Synopsis |
| 8 |
-------- |
| 9 |
|
| 10 |
**raw2tiff** [ *options ] *input.raw* *output.tif* |
| 11 |
|
| 12 |
Description |
| 13 |
----------- |
| 14 |
|
| 15 |
:program:`raw2tiff` converts a raw byte sequence into TIFF. |
| 16 |
By default, the TIFF image is created with data samples packed |
| 17 |
(``PlanarConfiguration=1``), compressed with the PackBits algorithm |
| 18 |
(``Compression=32773``), and with each strip no more than 8 kilobytes. |
| 19 |
These characteristics can overridden, or explicitly specified |
| 20 |
with the options described below. |
| 21 |
|
| 22 |
Options |
| 23 |
------- |
| 24 |
|
| 25 |
.. option:: -H number |
| 26 |
|
| 27 |
Size of input image file header in bytes (0 by default). This amount of data |
| 28 |
just will be skipped from the start of file while reading. |
| 29 |
|
| 30 |
.. option:: -w number |
| 31 |
|
| 32 |
Width of input image in pixels (can be guessed, see :ref:`raw-guess` below). |
| 33 |
|
| 34 |
.. option: -l number |
| 35 |
|
| 36 |
length of input image in lines (can be guessed, see :ref:`raw-guess` below). |
| 37 |
|
| 38 |
:option: -b number |
| 39 |
|
| 40 |
number of bands in input image (1 by default). |
| 41 |
|
| 42 |
.. option:: -d datatype |
| 43 |
|
| 44 |
type of samples in input image, where *datatype* may be one of: |
| 45 |
|
| 46 |
========= =================================== |
| 47 |
Data type Description |
| 48 |
========= =================================== |
| 49 |
byte 8-bit unsigned integer (default) |
| 50 |
short 16-bit unsigned integer |
| 51 |
long 32-bit unsigned integer |
| 52 |
sbyte 8-bit signed integer |
| 53 |
sshort 16-bit signed integer |
| 54 |
slong 32-bit signed integer |
| 55 |
float 32-bit IEEE floating point |
| 56 |
double 64-bit IEEE floating point |
| 57 |
========= =================================== |
| 58 |
|
| 59 |
.. option:: -i config |
| 60 |
|
| 61 |
type of sample interleaving in input image, where *config* may be one of: |
| 62 |
|
| 63 |
============= ================================ |
| 64 |
Configuration Description |
| 65 |
============= ================================ |
| 66 |
pixel pixel interleaved data (default) |
| 67 |
band band interleaved data. |
| 68 |
============= ================================ |
| 69 |
|
| 70 |
.. option:: -p photo |
| 71 |
|
| 72 |
photometric interpretation (color space) of the input image, where *photo* may |
| 73 |
be one of: |
| 74 |
|
| 75 |
=========== ============================================== |
| 76 |
Photometric Description |
| 77 |
=========== ============================================== |
| 78 |
miniswhite white color represented with 0 value |
| 79 |
minisblack black color represented with 0 value (default) |
| 80 |
rgb image has RGB color model |
| 81 |
cmyk image has CMYK (separated) color model |
| 82 |
ycbcr image has YCbCr color model |
| 83 |
cielab image has CIE L*a*b color model |
| 84 |
icclab image has ICC L*a*b color model |
| 85 |
itulab image has ITU L*a*b color model |
| 86 |
=========== ============================================== |
| 87 |
|
| 88 |
.. option:: -s |
| 89 |
|
| 90 |
swap bytes fetched from the input file. |
| 91 |
|
| 92 |
.. option:: -L |
| 93 |
|
| 94 |
input data has LSB2MSB bit order (default). |
| 95 |
|
| 96 |
.. option:: -M |
| 97 |
|
| 98 |
input data has MSB2LSB bit order. |
| 99 |
|
| 100 |
.. option:: -c |
| 101 |
|
| 102 |
Specify a compression scheme to use when writing image data: |
| 103 |
:command:`-c none` for no compression, |
| 104 |
:command:`-c packbits` for the PackBits compression algorithm (the default), |
| 105 |
:command:`-c jpeg` for the baseline JPEG compression algorithm, |
| 106 |
:command:`-c zip` for the Deflate compression algorithm, |
| 107 |
:command:`\-c lzw` for Lempel-Ziv & Welch. |
| 108 |
|
| 109 |
.. option -r striprows |
| 110 |
|
| 111 |
Write data with a specified number of rows per strip; |
| 112 |
by default the number of rows/strip is selected so that each strip |
| 113 |
is approximately 8 kilobytes. |
| 114 |
|
| 115 |
.. _raw-guess: |
| 116 |
|
| 117 |
Guessing the image geometry |
| 118 |
--------------------------- |
| 119 |
|
| 120 |
:program:`raw2tif` can guess image width and height in case one or both of these parameters are |
| 121 |
not specified. If you omit one of those parameters, the complementary one will |
| 122 |
be calculated based on the file size (taking into account header size, number |
| 123 |
of bands and data type). If you omit both parameters, the statistical approach |
| 124 |
will be used. Utility will compute correlation coefficient between two lines |
| 125 |
at the image center using several appropriate line sizes and the highest |
| 126 |
absolute value of the coefficient will indicate the right line size. That is |
| 127 |
why you should be cautious with the very large images, because guessing |
| 128 |
process may take a while (depending on your system performance). Of course, the |
| 129 |
utility can't guess the header size, number of bands and data type, so it |
| 130 |
should be specified manually. If you don't know anything about your image, |
| 131 |
just try with the several combinations of those options. |
| 132 |
|
| 133 |
There is no magic, it is just a mathematical statistics, so it can be wrong |
| 134 |
in some cases. But for most ordinary images guessing method will work fine. |
| 135 |
|
| 136 |
See also |
| 137 |
-------- |
| 138 |
|
| 139 |
:doc:`pal2rgb` (1), |
| 140 |
:doc:`tiffinfo` (1), |
| 141 |
:doc:`tiffcp` (1), |
| 142 |
:doc:`tiffmedian` (1), |
| 143 |
:doc:`/functions/libtiff` (3tiff) |