RAW2TIFF(1)

πŸ’– RAW2TIFF(1) πŸ’–

okay bestie, gather round, because we're talking about raw2tiff β€” the LibTIFF girlie whose whole personality is "I take your raw bytes and I make you a TIFF." πŸ’…


✨ NAME ✨

raw2tiff β€” create a TIFF file from a raw data file πŸŽ€


🌸 SYNOPSIS 🌸

raw2tiff [ options ] *input.raw output.tif

πŸ¦‹ DESCRIPTION πŸ¦‹

So raw2tiff converts a raw byte sequence into TIFF. That's the whole vibe. No cap. πŸ’–

By default, the TIFF image gets created with data samples packed (PlanarConfiguration=1), compressed with the PackBits algorithm (Compression=32773), and with each strip no more than 8 kilobytes. Those are the factory settings, the default outfit, the "I woke up like this."

But you can override all of that, or explicitly specify it, with the options described below. main character energy only ✨


πŸ‘‘ OPTIONS πŸ‘‘

  • -H number β€” Size of the input image file header in bytes (0 by default). This amount of data just gets skipped from the start of the file while reading. Like, we're not even looking at it. bye. πŸ™ˆ
  • -w number β€” Width of the input image in pixels. It can be guessed, see Guessing the image geometry below πŸ‘€
  • -b number β€” number of bands in the input image (1 by default). (the manpage literally writes this one as "option -b number", iconic formatting, we keep it πŸ’€)
  • -d datatype β€” type of samples in the input image, where datatype may be one of:
    • byte β€” 8-bit unsigned integer (default)
    • short β€” 16-bit unsigned integer
    • long β€” 32-bit unsigned integer
    • sbyte β€” 8-bit signed integer
    • sshort β€” 16-bit signed integer
    • slong β€” 32-bit signed integer
    • float β€” 32-bit IEEE floating point
    • double β€” 64-bit IEEE floating point

nine whole options, she ate πŸ”₯

  • -i config β€” type of sample interleaving in the input image, where config may be one of:
    • pixel β€” pixel interleaved data (default)
    • band β€” band interleaved data.
  • -p photo β€” photometric interpretation (color space) of the input image, where photo may be one of:
    • miniswhite β€” white color represented with 0 value
    • minisblack β€” black color represented with 0 value (default)
    • rgb β€” image has RGB color model
    • cmyk β€” image has CMYK (separated) color model
    • ycbcr β€” image has YCbCr color model
    • cielab β€” image has CIE L*a*b color model
    • icclab β€” image has ICC L*a*b color model
    • itulab β€” image has ITU L*a*b color model

a whole rainbow of color models, we love to see it 🌈

  • -s β€” swap bytes fetched from the input file. πŸ”„
  • -L β€” input data has LSB2MSB bit order (default). ✨
  • -M β€” input data has MSB2LSB bit order. ✨
  • -c β€” Specify a compression scheme to use when writing image data: -c none for no compression, -c packbits for the PackBits compression algorithm (the default), -c jpeg for the baseline JPEG compression algorithm, -c zip for the Deflate compression algorithm, -c lzw for Lempel-Ziv & Welch. pick your fighter πŸ’…

🧚 GUESSING THE IMAGE GEOMETRY 🧚

raw2tif can guess image width and height in case one or both of these parameters are not specified. bestie really said "I'll figure it out myself" 😭

If you omit one of those parameters, the complementary one will be calculated based on the file size (taking into account header size, number of bands and data type). If you omit both parameters, the statistical approach will be used. Utility will compute correlation coefficient between two lines at the image center using several appropriate line sizes, and the highest absolute value of the coefficient will indicate the right line size. math girlie behavior fr fr πŸ“

That is why you should be cautious with the very large images, because the guessing process may take a while (depending on your system performance). ⏳

Of course, the utility can't guess the header size, number of bands and data type, so it should be specified manually. If you don't know anything about your image, just try with the several combinations of those options. trial and error is a lifestyle πŸ’œ

There is no magic, it is just a mathematical statistics, so it can be wrong in some cases. But for most ordinary images the guessing method will work fine. ✨

ngl, it's giving "trust the process" but the process is literally just statistics, so keep that in mind.

πŸ’€ SEE ALSO πŸ’€

pal2rgb (1), tiffinfo (1), tiffcp (1), tiffmedian (1), libtiff (3tiff)


🫢 AUTHOR 🫢

LibTIFF contributors


1988-2025, LibTIFF contributors


and that's the whole page, bestie πŸ’– this one's from LibTIFF version 4.7, dated Jun 27, 2026 β€” go convert some raw bytes, you got this πŸ‘‘

πŸ“¦ where this page comes from