←back to thread

361 points Tomte | 3 comments | | HN request time: 0.53s | source
1. csense ◴[] No.43614632[source]
This is confusing.

A 1920x1080 24-bit RAW image is a file of exactly 6,220,800 bytes. There are only a few possible permutations of parameters: Which of the 4 corners comes first, whether the row-major or column-major order, what order the 3 colors are in (RGB or BGR), and whether the colors are stored as planes or not. (Without planes, a pixel's R, G and B bytes are adjacent. With planes, you essentially have three parallel monochrome images, i.e. cat r.raw g.raw b.raw > rgb.raw) [1]

What the article is describing sounds like something that's not a raw file, but a full image format with a header.

[1] One may ask, how does the receiving software know the file is 1920 x 1080 and not, say, 3840 x 540? Or for that matter, a grayscale image of size 5760 x 1080?

The answer is that, with no header, you have to supply that information yourself when importing the image. (E.g. you have to manually type it into a text entry field in your image editor's file import UI.)

replies(2): >>43615178 #>>43615289 #
2. porphyra ◴[] No.43615178[source]
> what order the 3 colors are in (RGB or BGR)

Camera raw files typically come in a raw bayer mosaic so each pixel has only one colour.

3. MagerValp ◴[] No.43615289[source]
> This is confusing.

We’ll, yes. You’re thinking of the classic RAW format that was just a plain array of RGB pixels without a header.

When talking about digital cameras RAW refers to a collection of vendor specific file formats for capturing raw sensor data, together with a bunch of metadata.