pouët.net

anyone using his own photo RAW conversion for greater art?

category: general [glöplog]
I thinking in feeding a raw file to the GPU and play with some shaders. Has anyone here done something similar?
I'm using LibRAW to decode the RAW file to an array of something more useable.
added on the 2010-04-28 05:53:08 by xernobyl xernobyl
not that I can help with the question, but.... I don't understand how one should _decode_ a _raw_ image. Isn't a raw image just... raw?
added on the 2010-04-28 08:23:30 by iq iq
iq: no. I suppose xernobyl means raw from reflex cameras. These usually are propietary and closed formats and/or not as raw as you would expect sometimes.
added on the 2010-04-28 09:00:21 by texel texel
or he might actually simply mean raw uncompressed data from digicams (e.g. turning off compression removes the possibilit of compression artifacts).
I think he means raw from DSLRs, so what texel said.

I'm doing this actually - I use the quicktime framework to dump raw images onto the gpu as 16/32bit float images. No idea if this works on windows - quicktime framework is available, but maybe it doesn't include raw support the same as on osx.

Stuff you need to watch out for:

Colour profiles. If you load the raw data directly the colours will be really inaccurate (this is part of what the 'normal' raw conversion software takes care of). If that matters, try to get hold of the colour profile and apply it at the end of the processing chain, or write your own colour curves stage (this is what I did).

Texture limits. This really fucked me over at one point.. my gpu supports 4k*4k textures, so I figured it would be enough for my purposes. Well, it's not 4k at all, it's actually the equivalent amount of vram for a 4k*4k 8bit image. So 2k*2k for 16bit, or 1k*1k for 32bit. I need 32bit, and 1k is useless :( (I'm doing tile based processing to get round this now..)
added on the 2010-04-28 10:31:40 by psonice psonice
I mean doing your own debayering.
added on the 2010-04-28 11:33:40 by xernobyl xernobyl
I have pure greyscale 12bits RAW data direct from the sensor. Now I'll try some simple linear interpolation of the bayer pattern to get some color. I'm not really sure where I'm heading with this.
added on the 2010-04-28 11:46:36 by xernobyl xernobyl
Using the GPU for this kind of stuff is certainly possible. It's what's being used by apps like SpeedGrade to do realtime debayering.
added on the 2010-04-28 11:52:14 by sagacity sagacity
Yeah, I can't see a problem with debayering on the gpu. Are you doing video or just stills (from .raw files)? At some point I might have to deal with video in a raw-like format (4k*4k sensors too.. luckily at very low framerates ;) so let us know how you get on.

One thing you might want to look at btw: if you have say a 1000 pixel sensor, the raw data is effectively at higher resolution (2000) because the colours are offset. You can use super resolution here to enhance the resolution, especially if you have video.
added on the 2010-04-28 13:29:21 by psonice psonice
Just stills.
There is no way to get RAW video from my camera. I've read some things about using super resolution in video in relation to the bayer pattern. It makes sense, because the image doesn't move from green to green, but from green to red to green to blue... Stupid firmware doesn't do that :(
I'm not sure what I want to do actually. It started from a discussion about digital black and white.
added on the 2010-04-28 14:28:52 by xernobyl xernobyl
BB Image
added on the 2010-04-28 14:42:10 by xernobyl xernobyl
Hmm.. digital b+w is interesting. You could have 'almost' 4x resolution quite easily, just by using the native resolution of the raw file and infilling the colours between pixels. You'd have some fringing, and perhaps some colour speckle where detail exists in one channel but not in others, but you could fix that mostly with some cunning shader magic :)
added on the 2010-04-28 14:51:45 by psonice psonice
That's how the RED camera gets its magic "4k" resolution from. Sure, it's a 4k sensor, but a bayered one. ARRI's cameras also have a bayered sensor, but they have the good sense to call it 2k resolution.

People don't care though, because 4k is "more" and "more" is "better" w00t RED RULES
added on the 2010-04-28 15:18:11 by sagacity sagacity
If they're doing something basic, I'd call it 2k+. If they're doing some super resolution magic, I'd take the '4k' any day :)
added on the 2010-04-28 15:30:25 by psonice psonice
http://www.thedailynathan.com/demosaic/
That site is interesting.

That pic I posted has the RAW image on the left (converted to an 8 bit PNG), the raw with the bayer pattern applied on each pixel, and a highly saturated photo from Nikon's NEF driver.

I can't find any info on demosaicing to black and white. It shouldn't be too complex. There's probably something better than interpolating and mixing each RGB channel.
added on the 2010-04-28 15:47:04 by xernobyl xernobyl
psonice: It's not super resolution sadly. It's tricky enough getting enough FPS out of a CMOS sensor as it is :)
added on the 2010-04-28 16:37:25 by sagacity sagacity
sagacity: the fps would be the same, super resolution is done in software later.
added on the 2010-04-28 16:46:55 by psonice psonice
The super-resolution for b&w is not possible as you might be thinking about.

If you have, a, let say, 6 mp camera, you don't have 6 million bayer patterns, but only 1.5 million bayer patterns.

So, the b&w algorithm should be like this:

- Use the best as possible demosaicing algorithm for colour. The best one depends on your image.
- Desaturate the image.

So, what you get is a 6 mp b&w image, and nothing more. So, only in really extreme cases you are going to do something better than just desaturating the image you got from the camera's demosaicing algorithm. One of these extreme cases would be a scene full of white/grey/black objects only with only full white light. Even in that case, you don't have more resolution as of megapixels, but maybe a sightly sharper image (and probably with more noise).
added on the 2010-04-28 17:00:07 by texel texel
Psonice: Oh, but then it's just interpolation. I thought you meant super-resolution in the sense of grabbing multiple slightly offset images and using that to make a bigger image.
added on the 2010-04-28 17:16:09 by sagacity sagacity
texel: so the 6mp camera effectively has <6mp resolution? Hmm.. that's a bit shitty! Well, it would still be possible to do super resolution and get that 24mp image, but it would no longer be trivial to to :)
added on the 2010-04-28 17:25:20 by psonice psonice
sagacity: there are many methods for super resolution, some use a single image rather than multiple. Multiple image methods tend to work better though.
added on the 2010-04-28 17:27:13 by psonice psonice
Isn't Super Resolution just for video?
added on the 2010-04-29 00:03:05 by xernobyl xernobyl
No, stills too. It's easier with video, that's all.
added on the 2010-04-29 00:32:19 by psonice psonice
Damn you, anti-aliasing filter!
From what I see anti-aliasing filters do more harm than good.
added on the 2010-04-30 03:37:20 by xernobyl xernobyl
anti-aliasing FILTER?
added on the 2010-05-03 11:40:55 by kusma kusma

login