Fuji X-Trans sensor Layout

I had a question about the xtrans and xtrans_abs properties. Inspecting the values of this property for a few RAW files I have, I noticed they take values 0, 1 or 2. I assume these represent R, G and B respectively.

Assuming that the visible portion of the image starts at (3, 2), does xtrans represent the repeating pattern starting at (3, 2) and xtrans_abs represent the pattern starting at (0, 0)?

On a different note, does libraw support RCCB and RYYB layouts? These Bayer sensors are quite popular in automotive.


LibRaw provided margins (left

LibRaw provided margins (left_margin, top_margin) are multiple of 6 (at least in 0.20 beta and in latest snapshots), so xtrans and xtrans_abs are the same.

-- Alex Tutubalin @LibRaw LLC


Thanks for the clarification. I am currently on 0.19.5 and so wanted to know if the information about margins still holds.

Also, is my understanding of what xtrans represents i.e. 0 -> R, 1 -> G, 2->B correct?

I'm not sure, that margins

I'm not sure, that margins are also multiple of 6 in 0.19. Extra effort is needed to analyze (source inspection, may be debugger session), so I won’t do it,

If not, xtrans[][] is for visible area, xtrans_abs[][] is for entire sensor (make sure you use LibRaw-provided margins).

0 is 'channel #0', 1 is 'channel #1', etc. Index to name mapping is in imgdata.idata.cdesc[] string.

-- Alex Tutubalin @LibRaw LLC