   RGB to Bayer
  Hi folks,  I´d like to know if there´s a way of transforming an image in RGB format to Bayer format data. I know that the other way (Bayer to RGB) is well documented is easily.Best regards.   
  What's the context for this? Are you dealing with RAW images? In that case, i would be inclined to say that reversing the process would yield somewhat undesirable results.   ;  It´s an experiment with cameras. I´m capting some images (in RGB format) with the cameras and processing them with a kind of a blackbox algorithm (I mean I don´t know the exact details of this algorithm). But my problem is that I must pass the images in Bayer format. But I didn´t get it why I will yield undesired results in this processing of converting RGB images to Bayer ones.Thank you.   ;  My (somewhat spotty at times) understanding is that bayer->RGB is sort of a one-way conversion. The jist of it is to "blend" the pixels to come up with an RGB image. "Unblending" (RGB->bayer) would not yield a true result (i think). You best bet would be to shoot in RAW mode and have the raw bayer pattern to start off with. If you need some samples, i could email you some CANON EOS DIGITAL shots.   ;  Hi leiavoia,   I also have this impression that Bayer->RGB conversion is kind a one-way, but I hope it would be possible (even with some losses) to "unblend" this result image. I searched internet how I could transform Bayer->RGB and I found some material, but almost no code, would you have sample code to do this transformation?   And well, I would appreciate some CANON EOS DIGITAL shots. ;)Thank you.   ;  If you want some Bayer->RGB code, look up the "DCRAW" project. The fact is, this algorithm is a well-kept secret because many competing commercial software packages use a form of it. Each different RAW converter has their own algorithm (or flavor thereof) and you can be sure they don't go and post their proprietary tricks on the web.DCRAW is an opensource RAW converter that works, at least, for Canon RAW images and a few others. Unfortunately, it's results are pretty ugly. I paid the money for a commercial converter. PM me your email and i'll send you some images. Make sure your inbox is 25MB or better. They are large.   