Saturday 28 May 2016

modern Phones as cameras

I recently bought an Oppo F1 phone (yes, the selfie expert ... what a wanking name) and found out that the camera is actually stunning, but at the same time I doubt that the pictures on the OPPO site were taken with it. This has led me to revisit what I already knew: pixel counts aren't everything (but they are something).

So this is kind of a review of the Oppo F1 camera ...

Oppo F1 has 13Mpix - So things should get better right?

One of the things which drove my decision to purchase this phone was because I strongly believe in the philosophy:
the camera you have with you is the best camera you have
while I don't always have my Panasonics with me I pretty much always have my phone with me. This is not to say that I'm trying to find a substitute for my Panasonic, but just to make what I have better.

So with that perspective in mind I thought I'd gradually over the course of time add my findings on this phone.

A criteria I've had on phones for some time is to have one which does RAW output, because I've said for over a decade (nearly 2) now that what really hobbles cameras is the crummy JPG software they provide. I've often said that the camera should just capture enough of a JPG to show you on the back screen (cos you don't want to raw convert every time you preview) and just store the RAW, which we can then process (if you like, as part of the transfer to your PC even).

The Oppo F1 stashes its RAW file into a DNG format, which is very tidy thank you because almost every raw converter on the planet reads that. So despite the fact that few people really make much of it DNG is indeed more of a standard than any particular cameras chosen RAW format. Thus the Oppo loomed on my horizon.

After a few quick snaps and looking at them on the phone I was already of the view it was a fine phoneCam. So I thought I'd start comparing the F1 to my Panasonic GF1, which some may argue is inferior to modern m43 cameras. However I've shown earlier using RAW demonstrates that all that has really happened in m43 (and all cameras really) is simply an increase in on camera JPG processing and more pixels).

I found that the Oppo F1 has an angle of view which is close to a 28mm wide ... which isn't bad for a scenery camera. So lets look at some "sunny day" stuff to see how the Oppo performs in "ideal conditoins".

Yesterday was a mixed weather day, but with no actual rain (despite the look) and so from my balcony this is the shot that the Oppo got

First, the good news


Overview with JPG



then what I was able to do with the DNG


anyone with much editing experience knows that you just can't rescue tonals like this out of a crummy JPG like the one above. So thats quite impressive.

Still, lets look at some details.

First the 100% view around the middle of the JPG


then the 100% view of the image from the DNG


well bugger me ... you ask for some Brie with your Red wine and you get a stick of chalk!

So what looks ok on the phone screen doesn't bear resemblance to what you can get out of the actual camera.

FFS Oppo, why are you shooting yourself in the foot with this camera by using such a lousy JPG engine ... its simply shameful and insulting to the engineers who made it.

Ok ... lets have a look at what my GF1 with the Panasonic 14-45mm lens on it gave

Overview


100% pixel peep:


You will really need to open them side by side to see the differences between the Oppo F1 DNG and the Panasonic ... So the GF1 has a few extra bits of tonality and nicer details but you know ... if you weren't printing a show piece (and were resizing for the WWW) then the Oppo F1 image would do just fine.

Now the bad news

(firstly, see the PS later)
As well as having an idiot do their JPG engine, Oppo's DNG has a few problems of its own.

I first loaded the DNG into my ACR and was stunned with how shitty the image result was;


I tried mucking with the obvious settings and it still sucked and so naturally I tried a few other options like RawTherapee, Photomatix and finally my old turn to command line 'dcraw'

Well bugger me dead but when put into "verbose" mode dcraw highlights what I believe to be the problem:

C:\temp\phone>dcraw -v -T C:\temp\phone\IMG20160527084439.dng
Loading OPPO     F1f image from C:\temp\phone\IMG20160527084439.dng ...
Scaling with darkness 64, saturation 1024, and
multipliers -1.#IND00 -1.#IND00 -1.#IND00 -1.#IND00
AHD interpolation...
Building histograms...
Writing data to C:\temp\phone\IMG20160527084439.tiff ...

Somehow the DNG file contains data which is corrupt or unreadable by my converters ... given that I've not had this problem with any DNG file I've ever had before I wonder if someone at Oppo is not following the correct file format for DNG ... or has skipped what they thought to be an irrelevant point (which clearly isn't).

So, when I produced a TIFF with these settings (some ball park scaling factors of the Red Green Blue Green channels)
C:\temp\phone>dcraw -v -T -r 2 1 1.5 1 C:\temp\phone\IMG20160527160051.dng
Loading OPPO     F1f image from C:\temp\phone\IMG20160527160051.dng ...
Scaling with darkness 64, saturation 1024, and
multipliers 2.000000 1.000000 1.500000 1.000000
AHD interpolation...
Building histograms...
Writing data to C:\temp\phone\IMG20160527160051.tiff ...

I got the above results.

So ... the Oppo can produce some fine results, but pretty much noone else is going to see them because:

  1. few play with RAW
  2. fewer understand RAW processing well
  3. fewer still are as command line approach

So Oppo, stop hiding your camera under crappy software and perhaps you'll get some better reviews than you find when Googling for Oppo F1 review. Almost everyone comments how the camera is "ok for the price" when in reality its a bloody good camera hobbled by (either) the wrong people doing the job or not giving them any time to do the job.

Not everything comes down to good hardware, although that's a start for sure.

I'll leave you with a final image comparison, this was taken in my garage with the sun setting, The light streaming through the windows is actually only an indicator of how dim it was. In there

The JPG overview


the center @ 100%


you can barely read any of the text on that box, and the bricks seem to have no texture, yet the same segment from the DNG processed as described above:


You can read the larger print on the box and you see that the bricks do have a texture.
Speaks for itself really ...

So come on Oppo, this can be fixed with a simple update to "Expert Mode" package on the phone. I recommend you do it (or someone does).

PS:other software

ACR 9.1 on Photoshop CS6 did a better job of the DNG file, as indeed did Snapseed, so my comments about tint are less applicable on those. However all other aspects after conversion were the same (and lets face it, the DNG was head and shoulder better than the the JPG).

Also, Snapseed does a fantastic job with the Oppo F1 files

Monday 2 May 2016

digital camera as film scanner

Seldom is there a topic which just can't be put down, even using a 12 gauge and solids with a double tap...


the "discovery" that a digital camera can be a scanner is just such a one. Over the last 20 years I've seen this topic come up and fade away on many forums over many camera generations.

Of course those with any professional experience or training would know this as "Copy Stand" work and is nothing new.

I'd say that the first time I owned a digital camera (sixteen years ago) I had a go at this myself. Nikon (who also made an excellent range of scanners) used to even sell attachments for their digital cameras to make this "easier". It sort of did ...

You know what? The results were always disappointing ... for a number of reasons. I'll only explore some of the basic ones here.

Ok, so that was then this is now ... surely the fantasmagorical ultraJizMatic modern digital cameras make the task a breeze ... right?

Well yes and no.

Executive Summary (for the TLDR set)


  • using the modern D-SLR (or in this case m43) with an appropriate macro lens will allow you to get as much detail (without splitting hairs) from 35mm film as a good modern film scanner from your Color Slides (chromes) and from your black and white negatives.
  • Color Negative is an entirely different story and will require a lot of work to even get close to a decent rendition of colour fidelity.
  • as the format gets larger (just like a FlexTight Scanner with its zooming CCD method) your ability to compete with even a desktop flatbed will go down. I have found that even 645 is pushing shit up hill with a fork and 6x7, 6x9 or god forbid 4x5 inch or bigger sheet will be left gasping compared to a flatbed like an Epson 4870 or later.

To do this you will need :
  • a good quality macro lens (to allow close focusing to fill the frame)
  • a uniform light source 
  • the ability to mung up some negative holders (and you thought the supplied ones with scanners were fiddly .. wait till you DIY your own)
  • a careful and methodical approach
  • a steep learning curve in RAW image processing
or you could save yourself the hassle and just go spend $100 on a good used Epson 4870 (I saw one on ebay in the usa for 49) or later model (such as V700 would be sweet). Spending a bit more on a Nikon film scanner would be even better. Get one of the later LS-50 series with USB 2.0

why is it so?

The problem is that color negative is not like people think it is. Broadly speaking people understand negatives are darker where light has reached and more transparent where light did not reach. This darkness is called density. There are two things about film you should know: 
  1. it has a maximium possible density (like left in the sun then developed) called henceforth Dmax
  2. and it has a minimum possible density (like developed without being exposed) and from now on called Dmin
Negative (if you look at one) clearly has some density even when its not exposed. In general terms this is called the base fog and you'll need to understand it to set your camera exposure to obtain the best exposure (more on that later).

The next thing about negative is that it is coloured ... unlike black and white negative it tries to record Red Green and Blue. Now people on the net bang on about the "orange mask" and try to sound important and knowledgable to newbies (I'll call them Wangers or ZOM) in an attempt to put them off. However essentially you don't need to consider the "orange mask" but you do need to consider this point carefully. I'll indent it and leave it isolated.

the change in density of colour negative is not equal in Red Green and Blue layers.
read that again just to make sure you have got it.

I recommend you take a moment to flick over this blog post of mine from 2009 (yes that's 7 years ago) and in that I show that simply by scanning, inverting and trimming up the captured channels to reflect the above facts of life that the mysterious Orange Mask is no longer apparent ... gone just like the designers intended ... so we can step around those zombies already.

So when you look at the data sheet from a Colour Negative you'll see they provide important stuff such as how each colour channel responds in density to light.

Looking at one such graph to the left you'll see that the density of Blue when its not even exposed to light is almost half way though the range of Red.

You'll see that the density of Red ranges from much more transparent to about half that of Blue or Green. 

You'll also see that Red has a much longer range of density than does Blue or Green.  So this leads to the problem for the digital camera that each of R G and B will have different Dmax and Dmin (quite unlike a scene).

Meaning that your histograms will look quite different in your digital camera. You'll need to set your exposure so that you don't clip either end and to be honest your digital camera is not set up to do this.

Yes, that's right, the makers made the camera to take photographs of the world outside, not as a scanner.

So part of your uphill battle has begun.

What we did

This all started because on a forum for m43 cameras I went out and said that I didn't think that a digital camera would do better than a dedicated film scanner. I opinioned that it may be close on 35mm but on larger formats (120 roll film and 4x5 sheet) that it wouldn't cut the mustard. One person stepped up to the plate and wanted to put his home brew rig (powered by a m43 EM-1 camera) up against my scanners in "the ring". So here we are :-)

To do this study, I scanned two negatives, one 35mm and the other 120 roll film and posted them to him so that he could have a bash on the exact negatives under consideration. He normally uses 120 in 645 format and I normally use it in 6x9 or 6x12 ... which means his 645 image will present a sharper image on the film because the entire system (645) is geared to be sharper because its going to make a smaller image (which will therefore be enlarged more for any given print size).


Looking at samples

First I thought I'd show you the success stories ... so (yes, about time I know ...) here is the best result our collaboration has yeilded, 35mm.
Firstly the overviews
Nikon LS-4000 35mm negative



and then the same negative with the EM-1


The first thing you'll notice is that there is slight colour cast differences ... why? Welcome to the world of colour negative scanning and the principle reason why the advertising crowd favoured "Chromes" or slide film ... ease of consistent colour reproduction (despite slides being inferior in other photographic ways).

That the result is this good is a major milestone to me as I have never before been able to achieve this sort of result

Why?
Well you can thank all the developments in RAW processing because folks this is a tough negative to capture for a camera because of the snow (which will push the Dmax up) and the shadows in under the tress in the background will pull the Dmin right down to the base fog (wedding white dresses in sunlight are equally torturous).

Luckilly my partner gave me a bracketed series of exposures, so to get this I had to pick though them all and find one without too much scrunching down of the Blue and without clipped reds. As it was I used one with clipped reds and used the amazingly good highlight recovery tools in ACR to get the snow and clouds looking as good as they were (and there is still a slight red cast if you ask me).

So lets look into some details of the captures:
  • The Nikon LS-4000 scans at 4000dpi and produced an image of 5458 x 3621 from the negative
  • The EM-1 has a sensor of  4608 x 3456 but for reasons I put down to cropping and alignment to get the image in we ended up with 4140 x 2773.
Lets look at detail:

The Nikon:


and the EM-1



which is immediately obviously that bit smaller due to pixels.

In terms of details I'm going to call them a tie, however I'm going to give the nod to the Nikon for better representing the shadows (which btw if you recall is the Dmin of the negative, so its actually the thinnest part and well within the cameras ability to record because of all the densities the shadows are well captured here). Some colour noise was apparent in the snow because (I assume) the highlight recovery (only involving the red channel) was not perfect.

But both are probably quite acceptable.

Where I'm going to call it an advantage to the scanner is in work involved to get this. With the scanner you insert the film and scan. You can tell the scanner its dealing with a negative so you don't do anything more than just
  • load
  • scan
  • obtain image
This can be done in a batch mode on a flatbed so you can load and go. Or if you want to really squezed the max from your negative, and you've chosen to scan as positive and invert (as in my blog post above):
  • load
  • scan
  • obtain image into editor
  • invert and trim up colour channel levels
With the camera
  • load (I'm sure more fiddly, or if you're just putting them on a light table and moving make sure your film is flat and well masked
  • photograph
  • transfer RAW file to your computer (assuming you know your correct ideal exposure for that negative type which you've previously meticulously recorded and tested and hope that your light source is consistent)
  • open in RAW editor and play with converting to an image (done in a tool like ACR)
  • make sure you move the histograms to best fit the range in
  • invert and trim up the colour channels
I'm willing to bet (having done the last steps here) that the entire process with the digital camera will be much slower - even if the capture time is faster.

Oh ... dust .. we didn't mention dust ... clean up your neg reall well because the Nikon has ICE which does a fantastic job of cleaning up Negatives ... its what it was made for.

Larger formats

So now lets move onto something bigger - 120 film. Now as I mentioned I use 6x9 format and its normally taken with my Bessa camera, which is a 1950's camera. 

A 6x9 camera makes a 6cm high image (occupying the entire film width) and stretching 9cm along the film. The 645 camera is more frugal with film and still makes a 6 cm high image but is only 4.5cm in length of the negative.

The designers of 645 took advantages of improvments in lenses to make more images out of a roll of film. So his camera is going to have better lenses meaning higher res negs.

So what this means is that we need to have higher res scans the film to obtain that higher resolution image. Its an obvious logical conclusion that the digital camera will not perform as well on the larger format as those same pixels are now capturing a bigger image.

I only have the Nikon LS-4000, not the 8000 or 9000 model needed for scanning 120 film, so I'll use my Epson 4870 flatbed. Its as its not a bad scanner but not anywhere near the quality of the Nikon. It does a resonable job of producing a genuine 2400 dpi: which is quite enough for 4x5 and 120 in 6x9 or larger. To get the most out of 645 you'll want / wish for a better result than my Epson.

So will the tradeoff in lower scanner quality equal that of the reduced ability of the Camera to capture?

Lets at what we got:

Epson 4870 

Now, keeping in mind that my partner is only intending to "scan cam" for 645 he did a section of the middle of this:

EM-1



He didn't photograph the full negative from because that would handicap his system for his needs. 

Why will it handicap him? 

Because the sensor of the camera will still only capture the same amount of pixels, photographing a larger price of film spreads the sensor capture to capture the same number of pixels but of a now greater length of film. Less pixels per inch. This is unlike my scanner which will capture more pixels the more INCHES it scans because it scans at constant 2400 Dots Per Inch, if it scans more inches, it gets more Dots (or pixels).

So, looking at the images in overview we have the same shadow colour casts here ... as the 35mm  above.

Ok, lets look at the image size details next:

  • The Epson produces a height (lets not worry about the width) of 5288 pixels
  • the EM-1 produced 3555 pixels presumably this could be tuned up a bit more, but 645 is not the same aspect ratio as 43'rds is so he's going to have to lose somewhere.
Clearly that's more pixels, but is it more details? Lets look now at 100% side by side


Firstly you will be more aware of the colour issues when its put side by side, none the less its immediately clear that the Epson has returned more detail from this film (taken with my 1950's bessa) than has the EM-1.  If you click the image you'll see that there is way more detail on the scan than on the camera RAW. So not only are we not capturing the outright possible details of a 645 system, we're not even approaching the limits of details that my old Bessa gives by using the EM-1.

What's more you'll not only see that there is details in the top of that fresh spruce sapling, but that it shows much better colour fidelity of the young trunk.

This is where I'm going to say this is probably a Bayer array issue, as has been found by others in high detail shots with small features of colour. Tim Parkin found this issue with his post on the missing red berries back in 2010.

Because we are capturing actual RGB pixels with the scanner but a R here, a G there and a B over there for the Bayer (and then assembling a virtual pixel in the middle of that) Array it means that colour fidelity will also suffer.

Adding to this all the above issues of handling and image transfer to me this really sinks the deal: for Color Negative in larger formats a Flatbed scanner will slam dunk the Digital Camera.

sharing my work

As I put an amout of effort into processing these RAW images I thought I'd share a little of that too. I got the impression that I did a better job of converting the RAW files into images than he did. Well lets look at those steps;

Firstly the ACR process ... I picked an image which I thought would have the best data range by inspeting in ACR, I changed the tint to move the channels around a bit:


I then changed the colour space to ProPhoto, knowing that had a wider gamut



notice how the reds are not clipped anymore? Yet all other parameters like exposure were not changed.

That got me this image:



and so then I inverted and tweaked up the R G and B (as per my tutorial above)







which got me this:


and then I rotated it and changed the "gamma" of each of the channels and applied a final curve to it (because digital camera curves are meant to match life not film)


So there you have it.

conclusion

Somehow everyone thinks that they are inventing the wheel. For as long as there have been cameras there have been copy stands. In essence using a digital camera to copy a negative with the negative in a holder is really "copy stand" work. This has always been problematic and companies like Kodak have gone to great lengths to develop films specific to the task of making copies of film or copies of prints.

 Back in the 90's companies like Creo made fantastic flat bed scanners, and this revolutionised the print and press industry. Eventually Seiko (who own Epson) made copies of those scanners and made them cheaper (if a lower quality). Then Nikon came along and made their excellent range of film scanners which evolved from the LS-1000 (which I still own) right through to the LS-5000 (which I never bought, I stopped at the LS-4000) which excelled at scanning ultra high detail on tiny film like 35mm (once thought of as miniature).

There is to my mind nothing better in the market for scanning 35mm colour negative film than the ultimate in the Nikon scanner series, even Drum scanners yeild little more (my post here from 2009). As film format size goes up, the effective "scanning" size of any digital camera goes down, while a flatbed just gets more and more competitive. If I was to scan my 4x5 at 2400dpi then I'd have 11,000 x 8,800 pixels ... to do that I'd need (ignoring the lens demands) a minimum 96 megapixel camera and to deal with the loss of details in colour due to the Bayer Array of digital cameras probably much more like double the dimensions or a square of the megapixel count.

The irony of all this is that for well under the cost of a good macro lens setup (preferably one with a bellows) you can get an Epson 4870 on eBay. Then you can keep your camera as a camera and have a film scanner that does a better job for less.

So while things have really made steps in advancement in processing a colour negative with a digital camera, we're not yet at the point where its better to do that with larger than 35mm. If you wanted to muck around with all this stuff  then yes, you could probably equal a 35mm scanner with your Digital SLR ... but its going to cost you at least as much in specialised lenses to do a good job and be harder work to obtain the results that a scanner does by design.

Acknowledgements

I would like to thank my partner in providing his side of this work. His effort in taking those images of the 35mm and the 120 film and his attention to detail in bracketing and focus accuracy (as well as masking the image to reduce contrast loss from lens flare) has helped make this comparison possible.

Before I began this I had not undertaken this for some years. When last I did this I entirely gave up on the idea because RAW processing did not even come close to making this possible (as the clipping of channels and reduced Blue channel width made the image look horrible). His provision of high quality image captures with his macro system and time and effort has made this possible.

I don't think he's owned scanners before, as many modern film users have come to film in reverse - that is from starting with digital.

I hope that this examination has shed light on the subject for other film users, and that given this you may consider that you can get more (much more) out of your film from this study and some of my blog posts linked to within this post.

Hope you've enjoyed the ride. And remember ... don't be stingy with your bullets and remember to enjoy the little things.