Monday, October 22, 2012

Green finished...

Yes, I think I'm there... had some trouble finding the right formula to get the luminance back after the math to calculate green, but that's also solved, which opens up the way (I think) to a proper red and blue filter...

Let me show you two examples.

All settings on the photos are similar. The regular and the green result were edited exactly the same (same contrast, brightness, exposure settings etc...)

First my Leica test photo... regular monochrome and green filtered on the highest setting...

Move over the image with your mouse to see the difference... from regular to green filtered...

(possibly in some browsers this doesn't work - not fully sure... if you see no difference you either have a visual problem or your browser doesn't support the rollover... you then just have to believe me :-) )


Regular monochrome from Leica M9...
Move over the image to see the green filtered monochrome...

And here's an example from the Canon 5D Mark III


Regular monochrome from Canon 5D Mark III...
Move over the image to see the green filtered monochrome...

The effect is quite strong on the blue and red, but this is on the highest strength setting. The setting can be changed in steps of 5%, so there's quite a bit of room to pick a favorite strength...

Will still take a few days till the next release, with obviously this green stuff in it, since I'm also working on a dead pixel mapper I want to finish up first.

Wednesday, October 17, 2012

About Green and other stuff...

Getting there.

As written before, the complications were the Canon files.

At least, that's what I thought.

So I mainly looked for differences between the sensor readings of Leica and Canon.

But despite some differences (Canon seems to favor blue a little bit more than Leica does) it didn't make much sense.

The Leica values and the Canon values were too close to explain the big differences I was seeing.

Then I thought I had the model wrong. Not YUV but maybe YCbCr (in the second one the red and blue are gamma corrected), so I tried that. And that did lead to better results, but was also very photo specific. One photo would need a high setting, another photo a low setting... and in some situations the strength setting would cancel out the gamma setting and the filtering would hardly be noticeable.

Overall it wasn't very satisfying, since I still didn't understand what was going on.

Then, at some point, when I was just lazying around, thinking about this problem, I suddenly realized that in all my tests I had been ignoring the black level, and that the black level might not appreciate that very much.

In my Canon test photos the black level was much higher than in the Leica test photos. It explained the big differences I was seeing.

And indeed: incorporating the original black level in the calculations solved it all.

No more need to gamma correct, it just works on the linear data... for Canon and for Leica and for all kinds of black levels.

I've also been working on a red RGB and blue RGB filter. Quality wise they seem to perform better than the chrominance red and blue filters, but the results are also different (gray-toning wise), so the chrominance filters will stay.

And I still need to figure out if the new red and blue filters require some extra coding on the opposite end of the scale (the white level), since there similar issues might exist.

Anyway, I expect to have these three extra filters finished now pretty soon, in the meantime thinking about orange and yellow...

Sunday, October 14, 2012

DNGMonochrome 0.9.52 beta released

With one bug fix.

The RawImageUniqueID, stored in the DNG, was responsible for the somewhat strange behaviour of Lightroom, where after selecting a monochrome DNG, the wrong preview picture would be shown briefly (provided you had imported multiple monochrome DNGs, created from the same original photo).

The RawUniqueID is now filled for every monochrome DNG with indeed a unique value, and that solves the problem.

You can download the new version of DNGMonochrome here.

Friday, October 5, 2012

DNGMonochrome 0.9.5 beta released

[Edit: after releasing 0.9.5, I discovered the new quality slider was not fully operational on the blue filter... that's fixed in 0.9.51, which is currently the version on the download page]

This version improves the working of the quality slider by using a different method, leading to a tighter integration between the smooth and the sharp algorithms.

It leads to overall better results compared to the old method.

Be aware that I'm talking pixel peeping magnifications here (200% to 400%). You'll probably not notice the differences when viewing at 100% or when downscaling the photo.

The quality slider is mainly useful when you want to print large (over 100%), and the usage of it is strongly advised if you go for the red filtering or blue filtering.

The green filtering is not introduced yet in this version, since I'm still experimenting.

It works very nicely for the Leica files, but the numbers on the Canon files do not lead to the right results. I'm still figuring out what the difference is. It is to be expected obviously, since the two companies do not share the same Bayer filter or sensor, so the specs are different.

Also in this version the Canon EOS 5D mark III is now supported.

For Canon users: you first have to convert your CR2 file to DNG with the free Adobe DNG converter and the end product is a monochrome DNG that can not be read by DPP.

You can download the new version of DNGMonochrome here.


Lightroom and Canon files

I discovered the Lightroom preview / cache gets confused on the Canon files.

If you have imported multiple copies of one original DNG (say a regular monochrome DNG and a red filtered monochrome DNG of the same photo), switching to the red filtered monochrome in Lightroom will briefly show the regular monochrome one. It's harmless but looks weird. If you have only one monochrome copy loaded into Lightroom, this problem doesn't occur.

It also doesn't occur on Leica monochrome DNGs, which leads me to believe that it might have something to do with a specific DNG setting put in by the Adobe DNG converter.

Another possibility is that it's a local cache issue, to do with my Lightroom setup.

As said: it's harmless, the correct DNG is shown once Lightroom has it properly loaded after selection, but I will be investigating this issue anyway, see if I can figure out what's causing it.

Wednesday, October 3, 2012

So, how about a green filter?

Yeah.

That was a bit of a complication.

DNGMonochrome has the ability to produce a red filtered photo and a blue filtered photo.

Given that the Bayer filter has three colors (green, red and blue), you might expect producing a green filtered photo would be easy. In fact, you might even think the regular result - based on the green pixels - is already a green filtered photo.

But that's not the case.

The Bayer filter - as explained in one of the previous posts - is set up in the luminance / chrominance model. It means the green pixels register 'luma' and the the red and the blue pixels register 'chroma'.

So where is green?

Well, as far as I understand it now, the Bayer filter operates in the YUV model, which means there is no green.

Nah, obviously there is, but not the RGB green. You can't reach green in the YUV model without converting the values first to the RGB model.

Y stands for luma, U is chrominance blue, and V is chrominance red.

No green.

But how to convert to RGB without color interpolating?

Well, turns out it's fairly easy if you first interpolate the luma (the regular monochrome photo), then the red and the blue filtered photo. Then after applying some simple math, you can calculate the green.

But it's slightly unfair, since for a red and blue filtered photo, it's the chroma red and chroma blue that's being used, not the RGB red and blue, so I might introduce additional filters (a full RGB set, also for red and blue).

I'm not done with this issue...


Why?

Now you might think: why go through all that trouble of interpolating three photos to get to a green filtered (or blue or red filtered) one?

Well, maybe I'll show you next time, but if you think Lightroom can offer the same, you're probably mistaken.

I tried getting to a similar result in Lightroom with the HSL sliders and the color mixer. It's impossible to get to the same DNGMonochrome result without degrading the image.

The strength of DNGMonochrome sits in the fact that it interpolates the photo on one aspect of the color (either luma, chroma, or now also RGB green), whilst Lightroom starts messing with individual pixels, pulling or pushing certain gray tones, introducing artifacts if you go sliding too wild.

They could implement a similar thing - interpolate new after making an adaptation - but the slowdown would also slow down their sales I suspect... it's one of the advantages of giving software away for free: I don't have to bother about sales :-)

Tuesday, October 2, 2012

DNGMonochrome 0.9.41 beta released

This version solves the issue where converted CR2 files from the Canon EOS 5D Mark II would lead to monochrome DNGs that couldn't be read by Lightroom...

If you're not interested in processing CR2 files and you're already using version 0.9.4, there's no need to update to 0.9.41.

You can download this new version here.

Monday, October 1, 2012

DNGMonochrome and the EOS 5D Mark II

Got informed by a user (thanks Olivér) that the 5D Mark II converted CR2 files do produce a monochrome DNG, but that Lightroom has trouble reading them.

I use several programs to test the results in, but apparently I forgot to see how Lightroom deals with the 5D DNGs. For the EOS 350D and 40D things go smooth and fine, no problems there, but the 5D Mark II is a bit problematic.

Turns out DNGMonochrome produces a DNG for these files with an uneven number of rows (the 'height' is off) and Lightroom doesn't like that.

This bug is fixed, but I want to run some additional tests to make sure there's no problem with the borders of these DNGs.

So if you want to use DNGMonochrome for Canon 5D Mark II CR2 files, please be patient. The next release (somewhere this week) will fix the problems.