How to specify bayer pattern when converting raw to RGB

Hi, I am trying to convert a bayer RAW file to JPG with this command :

gmic -input test.raw,uchar,640,480,1 -bayer2rgb 1,1,1 -output test.jpg

test.raw is a bayer raw image with 640x480 8 bits without any headers.

The question is : How can I specify the image pattern of the color filters RGGB, GBRG, GRBG or BGGR ?

Thanks and regards.

This is not possible to specify the image pattern right now, I guess this command works with RGGB by default.
Anyway, it should be possible to tweak the image geometry a little bit before and after to make the input follow the RGGB pattern before the reconstruction. For instance, you can add or remove the first column and/or the first row when necessary:

  • For GBRG : $ gmic test.raw,uchar,640,480,1 -rows. -1,100%
  • For GRBG : $ gmic test.raw,uchar,640,480,1 -columns -1,100%
  • For BGGR : $ gmic test.raw,uchar,640,480,1 -crop -1,-1,100%,100%

Thanks, I will check it.

Regards.