Pages: 1 2 3 [4] 5 6 ... 9   Go Down

Author Topic: How to convince Sony to do lossless raw on A7RII and others?  (Read 66869 times)

BrianVS

  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #60 on: June 23, 2015, 07:54:46 pm »

Sony assumes that their customers are not going to apply a lot of post-processing to the images, hence they will be happy with the lossy/compressed file.

More sophisticated users know the difference, and cannot understand why any company would not offer lossless compression. Sony is not the only camera company to make this decision, Leica just made it with the M246- bringing it out as a 12-bit camera. They made the same mistake with the M8. At least with the M8 the firmware has a back-door to get lossless RAW out of it. I'm sure the Sony camera can be hacked in a similar fashion.
Logged

shadowblade

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2692
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #61 on: June 23, 2015, 08:51:56 pm »

Sony assumes that their customers are not going to apply a lot of post-processing to the images, hence they will be happy with the lossy/compressed file.

More sophisticated users know the difference, and cannot understand why any company would not offer lossless compression. Sony is not the only camera company to make this decision, Leica just made it with the M246- bringing it out as a 12-bit camera. They made the same mistake with the M8. At least with the M8 the firmware has a back-door to get lossless RAW out of it. I'm sure the Sony camera can be hacked in a similar fashion.

A stupid assumption, considering how many A7r adopters are ex-Canon refugees looking for a decent sensor to put behind their lenses, in order to shoot architecture, landscapes and other non-moving subjects. And Sony knows this, considering that they were including a Metabones adapter with every A7r body sold in Australia.

This isn't a stock-standard, low-cost, crop-sensor mirrorless system that appeals to point-and-shoot beginners wanting to 'step up'. It's a full-frame system with a top-tier sensor and professional users and needs the firmware to go along with the hardware.
Logged

Ray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 10208
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #62 on: June 23, 2015, 09:41:38 pm »

Well, I'm not nearly as technically oriented as some of you guys, and I don't pretend to precisely understand these compression processes and all the circumstances where image flaws might become apparent during post processing, as a result of the lossy compression used.

However, what seems odd to me is that Sony should market an upgrade to the A7R which boasts the first BSI full-frame sensor, and yet still use the same old, lossy compression algorithms that the A7R uses.
Isn't the entire purpose of the BSI design to improve image quality, particularly dynamic range? Since the DR of 36mp full-frame sensors, as in the A7R, D800 and D810, is already close to 14 stops at the pixel level, wouldn't a BSI sensor push that limit even closer to a full 14 stops?

Out of curiosity, I just checked the DXOmark DR results for the A7R, D800E and so on. Whilst the D810 has a worthwhile advantage of around 2/3rds of a stop at its base ISO of 64, which is a lower ISO than the A7R's base ISO, the D800 and D800E have a fairly similar DR to the A7R, at their base ISOs of 100. The A7R is only a relatively insignificant 1/4th of a stop worse.

I wonder if Sony has lost a marketing opportunity here. In addition to announcing so many innovative features in the A7R2, the BSI design being one of the major features, surely Sony could have added to their marketing spiel, something along the following lines:

"In view of our breakthrough technology in being the first company to introduce a full-frame 35mm BSI sensor, we have considered it advantageous to our precious customers who have the ultimate, image-quality discernment, to also introduce the option for a full 14 bit uncompressed, RAW image pipeline, so that the full potential of our BSI design can be appreciated." (Or should I have written B ull S h I t design.)  ;D
« Last Edit: June 23, 2015, 09:52:41 pm by Ray »
Logged

Jack Hogan

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 797
    • Hikes -more than strolls- with my dog
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #63 on: June 24, 2015, 02:30:59 am »

Sony assumes that their customers are not going to apply a lot of post-processing to the images, hence they will be happy with the lossy/compressed file.

More sophisticated users know the difference

Do you have an example image of 'lossy/gamma' raw compression showing artifacts when the uncompressed one doesn't, after a lot of PP?  I ask because I have looked (ignoring the delta thing) and I have yet to find one, no matter the PP.  Different data, yes; but with the same visual information.  Here's a question: how many bits of information (not data) do you need to fully encode scene information as captured by a specific current digital camera?  What would be the point of storing it in a larger data format, if scene information has been fully stored in both sets of raw data?  Information and rocket scientists have a pretty good idea.  Sony and Nikon speak to both.

Here is an example where the same image information was apparently saved at 14 bits and 10 bits, with both subjected to aggressive adjustments (scroll down to the images in the 'Taking Video Path out of Equation' section).  No difference I can spot.  There is a huge stock of 'lossy' compressed captures PP'd by Nikon users going back at least 10 years, so I would hope Nikon has had plenty of time and hw iterations to fine tune what 'fully' means, with safety margins.  My D610 has an 11.5 bit lookup table.  Some think this is overkill.

I am genuinely interested in investigating this further so I would welcome some examples if anybody has any.  Thanks for yours, Erik, I agree with you that that artifact should not be caused by 'gamma encoding'.

Jack
« Last Edit: June 24, 2015, 03:01:35 am by Jack Hogan »
Logged

BrianVS

  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #64 on: June 24, 2015, 04:51:56 am »

I can only answer this question for the Leica M8. I've stopped using the DNG-8 and (almost) always shoot it with the recently unlocked RAW mode. Button dance, then converted to full 14-bit DNG.

This is with RAW mode, full 14-bits:

L1000439 by fiftyonepointsix, on Flickr

This is the "Difference Frame", computed by taking the above image, compressed to DNG-8, expanded, then subtracted. Values scaled back to original white values.

DNG8DIF2 by fiftyonepointsix, on Flickr

This is the portion of the image that gets thrown out.

Below v

This is the Leica M8 at ISO2500, DNG-8 as supported by the firmware:

M8_3_DNG8_ISO2500 by fiftyonepointsix, on Flickr

100% crop:

L1015453_crop by fiftyonepointsix, on Flickr

Same shutter-speed/F-Stop, ISO160, RAW mode, then pushed 4 Stops in Post.

M8_3_F15_ISO2500 by fiftyonepointsix, on Flickr

100% crop:

L1015454_Crop by fiftyonepointsix, on Flickr

No noise-reduction, No Sharpening

I took the M Monochrom and the M8 to the Marine Museum, set the M Monochrom to ISO5000 and set the same shutter-speed/F-Stop on the M8 with the M8 at ISO160 and RAW mode for this shot:

M8_5_F4_ISO5000 by fiftyonepointsix, on Flickr

Then pushed in post.

This image is "unique", Orange filter to block Blue, leaving that channel sensitive to IR.

I1015873 by fiftyonepointsix, on Flickr

The Blue channel is then pushed to match the intensity of the other two channels, DNG channel assignment "rotated" as in Infrared Ektachrome. Custom FORTRAN code written for this.

So- I figure almost a 2-stop gain by having the uncompressed image from the 9-year old sensor. On the Nikon Df, did a test between compressed/uncompressed, also picked up ability to push in post. But- did not examine it in detail. Just never used compressed again.
« Last Edit: June 24, 2015, 08:29:43 am by BrianVS »
Logged

Jack Hogan

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 797
    • Hikes -more than strolls- with my dog
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #65 on: June 24, 2015, 09:36:07 am »

I can only answer this question for the Leica M8. I've stopped using the DNG-8 and (almost) always shoot it with the recently unlocked RAW mode. Button dance, then converted to full 14-bit DNG.

This is with RAW mode, full 14-bits:

Thanks Brian,

A quick check on Leica M8's DNG-8 came up with this

Quote
Leica M8 raw files are saved as a 8-bit DNGs.

Here we are debating whether 11-bits is enough to contain scene information: we know that 8-bits is definitely not enough - as shown by the images converted to 8-bits in the earlier link.  One last comment: difference images are popular in this context but they typically do not prove or disprove loss of information: we all agree that the data is different (heck one set is typically 10-20% the size of the other).  The question is whether the visual information is different.

Jack
Logged

BrianVS

  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #66 on: June 24, 2015, 11:51:29 am »

The way to answer the question would be to take a 14-bit image that is lossless, and implement the Sony compression algorithm for it. Compress/Decompress the image, then subtract from the original. The difference frame is what you are losing. As I own an M8, and the file format is documented, was the easiest for me to work with.

Does anyone have a link to source code that implements the Sony compression/decompression scheme? I could incorporate "C" code into my DNG code, compress/uncompress then do the difference frame. I also have the IEEE Mixed-Radix FFT in the same code. I got what was needed from the difference frame- at 100% crop the edges stood out, but the frequency content is what most depend on.
« Last Edit: June 24, 2015, 11:56:26 am by BrianVS »
Logged

ErikKaffehr

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 11288
    • Echophoto
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #67 on: June 24, 2015, 02:05:50 pm »

Hi,

Jim Kasson has made a lot of work on that about a year ago. This is at the end of those discussions: http://blog.kasson.com/?p=4854

Best regards
Erik

The way to answer the question would be to take a 14-bit image that is lossless, and implement the Sony compression algorithm for it. Compress/Decompress the image, then subtract from the original. The difference frame is what you are losing. As I own an M8, and the file format is documented, was the easiest for me to work with.

Does anyone have a link to source code that implements the Sony compression/decompression scheme? I could incorporate "C" code into my DNG code, compress/uncompress then do the difference frame. I also have the IEEE Mixed-Radix FFT in the same code. I got what was needed from the difference frame- at 100% crop the edges stood out, but the frequency content is what most depend on.
Logged
Erik Kaffehr
 

Jack Hogan

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 797
    • Hikes -more than strolls- with my dog
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #68 on: June 24, 2015, 04:28:55 pm »

The way to answer the question would be to take a 14-bit image that is lossless, and implement the Sony compression algorithm for it. Compress/Decompress the image, then subtract from the original.

Right Brian, this is what I was referring to. Imho the subtraction would show the difference in the data, not necessarily the difference in visual information contained within the data.  It may show you where compression occurred, that's it.

If you've followed the balance example, it would be like saying that the difference between the weight of the same tomato weighed and written down by person one (0.52428kg) vs that recorded by person two (0.52Kg) is 4.28 grams.  But if the best ever accuracy possible out of the balance is just two significant digits and no more - what value does the difference have?  It's just a random number which just shows you that in that particular spot compression was at work.  So next you need to look at the compressed vs uncompressed images there.  If you cannot see a difference, even after equal amounts of PP, there was no loss of visual information.  If there was, you'll be able to see it.  As was shown in the earlier link.

Data is the frame, visual information is the picture.  The picture does not change when one changes the frame as long as the new frame is big enough. 

Jack
Logged

BrianVS

  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #69 on: June 24, 2015, 07:27:55 pm »

I  have used difference frames for 35 years when doing image processing. It's the way to find out what has changed when performing an operation on an image. The problem with the Sony compression algorithm is that it depends on image content and the performance is chaotic.

I've used difference frames to examine image compression for JPEG, Wavelets, and other schemes over the decades. It shows the information lost, and makes artifacts that get introduced by the algorithm stand-out. My boss 35 years ago would ask "does it preserve the point response of the sensor?" Noise spikes that exceed the point-source response of the system, those are fair game. Diminish the point response, throw away information. I'd rather have the noise included in the image, makes it easier to get rid of.

There has been a lot of examples on the Internet showing the effects of the 11-bit compression scheme on images. If I owned one, I'd probably write code to test it myself- once the Raw mode had been unlocked. As it is, I am happy with the Nikon Df, Leica M9, M Monochrom, and M8. With Sony- too bad the first BSI Full-Frame sensor has been crippled.
« Last Edit: June 24, 2015, 07:35:08 pm by BrianVS »
Logged

BernardLanguillier

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 13521
    • http://www.flickr.com/photos/bernardlanguillier/sets/
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #70 on: June 24, 2015, 07:32:53 pm »

The question is really where you come from and what additional value you can expect to get.

If smaller size is important then the value of the a7rII probably far over shadows the concern with lossy raw.

If size isn't that important, then there are other excellent options.

As far as I am concerned, I'll wait until this is fixed.

Cheers,
Bernard

Jack Hogan

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 797
    • Hikes -more than strolls- with my dog
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #71 on: June 25, 2015, 04:39:13 pm »

I've used difference frames to examine image compression for JPEG, Wavelets, and other schemes over the decades. It shows the information data lost, and makes artifacts that get introduced by the algorithm stand-out. My boss 35 years ago would ask "does it preserve the point response of the sensor?" Noise spikes that exceed the point-source response of the system, those are fair game. Diminish the point response, throw away information. I'd rather have the noise included in the image, makes it easier to get rid of.

That sounds like good advice, Brian.  How would one apply it to a photographic image?

I'd rather have the noise included in the image, makes it easier to get rid of

If one is throwing away random digits one can always add them back at any time if needed.  I can't think of a situation where they would be, but one could.

Jack
« Last Edit: June 25, 2015, 04:42:31 pm by Jack Hogan »
Logged

Jim Kasson

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2364
    • The Last Word
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #72 on: June 25, 2015, 05:31:11 pm »

I  have used difference frames for 35 years when doing image processing. It's the way to find out what has changed when performing an operation on an image. The problem with the Sony compression algorithm is that it depends on image content and the performance is chaotic.

I've used difference frames to examine image compression for JPEG, Wavelets, and other schemes over the decades. It shows the information lost, and makes artifacts that get introduced by the algorithm stand-out. My boss 35 years ago would ask "does it preserve the point response of the sensor?" Noise spikes that exceed the point-source response of the system, those are fair game. Diminish the point response, throw away information. I'd rather have the noise included in the image, makes it easier to get rid of.

There has been a lot of examples on the Internet showing the effects of the 11-bit compression scheme on images. If I owned one, I'd probably write code to test it myself- once the Raw mode had been unlocked. As it is, I am happy with the Nikon Df, Leica M9, M Monochrom, and M8. With Sony- too bad the first BSI Full-Frame sensor has been crippled.

Here are two different ways of looking at original and cRAW companded difference frames:

http://blog.kasson.com/?p=4838

Jim

Jim Kasson

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2364
    • The Last Word
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #73 on: June 25, 2015, 05:34:33 pm »

That sounds like good advice, Brian.  How would one apply it to a photographic image?


WRT cRAW compression, the only way I've found it at all useful is with simulations, since the real original is not accessible (and my, in fact, never exist).

Even with simulations, it's of limited utility to me, since it doesn't inform on the issue of how visible are the artifacts.

Jim

BrianVS

  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #74 on: June 25, 2015, 06:44:12 pm »

As the 14-bit raw images are not available from the Sony, the easiest way to test this would be to implement the compression/decompression algorithm and apply it to an uncompressed image from a different camera. The Leica files are easy to work with as the file format is documented. Unpack the image, apply the compression/decompression, subtract from the original.

http://www.rawdigger.com/howtouse/sony-craw-arw2-posterization-detection

A good description of the algorithm. Basically an 11-bit tone curve using further compression in 32-pixel chunks, that scales max-min to 7-bits. Chaos.

With noise reduction- it's easier to eliminate from the image when it has been resolved, rather than "folded" into the image. The noise is "too sharp" when it is resolved. The noise will always be there, it's analog. If you don't have enough bits to resolve the noise, it will still affect the image at contour boundaries- analog levels that are at the limit of a bit. The noise will cause levels at a contour to fluctuate between them, easy to see with the Leica DNG-8. Average noise may be reduced, peak-to-peak will be increased.
« Last Edit: June 25, 2015, 07:19:56 pm by BrianVS »
Logged

Jim Kasson

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2364
    • The Last Word
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #75 on: June 25, 2015, 07:10:03 pm »

As the 14-bit raw images are not available from the Sony, the easiest way to test this would be to implement the compression/decompression algorithm and apply it to an uncompressed image from a different camera. The Leica files are easy to work with as the file format is documented. Unpack the image, apply the compression/decompression, subtract from the original.

With noise reduction- it's easier to eliminate from the image when it has been resolved, rather than "folded" into the image. The noise is "too sharp" when it is resolved. The noise will always be there, it's analog. If you don't have enough bits to resolve the noise, it will still affect the image at contour boundaries- analog levels that are at the limit of a bit. The noise will cause levels at a contour to fluctuate between them, easy to see with the Leica DNG-8. Average noise may be reduced, peak-to-peak will be increased.

Here's what you asked for, but using a synthetic image plus simulated photon noise instead of a real image with the real photon noise:

http://blog.kasson.com/?p=4847

And here is the difference image if you leave out the delta mod piece of the algorithm, and just keep the tone curve:

http://blog.kasson.com/?p=4854

Jim
« Last Edit: June 25, 2015, 07:12:40 pm by Jim Kasson »
Logged

BrianVS

  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #76 on: June 25, 2015, 08:05:51 pm »

The algorithm is not much more difficult to code up than the Leica DNG-8, the 11-bit/7-bit algorithm is similar to the lossless running difference compression scheme that I coded up 30 or so years ago. For the latter, the first raw pixel value is stored for each row then differences between pixels coded as 8-bits, -127:127 with 'ff'x reserved as an escape to store a full value pixel when the difference exceeded 8-bits.

Sony's 11-bit tone curve has a maximum error of 32 counts, before the 7-bit lossy compression compounds it. The Leica DNG-8 has a maximum error count of 127 counts. Peak-to-Peak noise is increased by the max error count.
« Last Edit: June 25, 2015, 08:08:17 pm by BrianVS »
Logged

LKaven

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1060
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #77 on: June 25, 2015, 09:59:16 pm »

The algorithm is not much more difficult to code up than the Leica DNG-8, the 11-bit/7-bit algorithm is similar to the lossless running difference compression scheme that I coded up 30 or so years ago. For the latter, the first raw pixel value is stored for each row then differences between pixels coded as 8-bits, -127:127 with 'ff'x reserved as an escape to store a full value pixel when the difference exceeded 8-bits.

Sony's 11-bit tone curve has a maximum error of 32 counts, before the 7-bit lossy compression compounds it. The Leica DNG-8 has a maximum error count of 127 counts. Peak-to-Peak noise is increased by the max error count.

The main advantage for Sony's lossy scheme is that it is performed on fixed parcels that can be implemented in simple hardware registers on the sensor. 

I would be very interested to take a D810 lossless raw, and a copy of the D810 raw converted to Sony lossy raw, and perform an extensive set of DSP filters/adjustments on both of them to see what artifacts one would find. 

Jack Hogan

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 797
    • Hikes -more than strolls- with my dog
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #78 on: June 26, 2015, 03:44:22 am »

Here's what you asked for, but using a synthetic image plus simulated photon noise instead of a real image with the real photon noise:

http://blog.kasson.com/?p=4847

And here is the difference image if you leave out the delta mod piece of the algorithm, and just keep the tone curve:

http://blog.kasson.com/?p=4854

Jim

Very good analysis, Jim.  If those routines are still around it wouldn't be too hard to implement Luke's idea below with a natural image, would it? ;-)
Logged

BrianVS

  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
Re: How to convince Sony to do lossless raw on A7RII and others?
« Reply #79 on: June 26, 2015, 05:09:30 am »

I had the misconception that Sony was somehow using a 14-bit base value rather than an 11-bit curve with a 7-bit difference spread across 16 pixels. think of it as "Bit Robbing". It compresses to 8-bits, acts like an 11-bit curve most of the time, and can go horribly bad in some situations. I'm thinking of some of the Vivitar ads with the girl flinging her hair up and the flash firing behind her. Artifacts will be much worse than those created by the DNG-8 scheme based on image content as the error will span 32 pixels. Why would any sane company develop a full-frame BSI sensor and use this algorithm?

I'll probably code up the algorithm in FORTRAN, plug it in where I have the DNG-8. I suspect the curve shown in the Link is approximate, with just a few data points on the curve shown and lines connecting them. The DNG-8 curve is generated by multiplying times 4 to get 16-bits, then take the square root. A similar DNG-11 curve would be computed by multiplying the 14-bit value by 256 (shift by 8 bits) to give a 22-bit value, then taking the square root to get to 11-bits. Nikon .NEF files are not as easy to work with as the Leica DNG files. The latter stores the entire image as one strip, just read it into a buffer and pass it to the subroutine as a 2-D array with Column and Row read in from the Sub-IFD.
« Last Edit: June 26, 2015, 05:27:55 am by BrianVS »
Logged
Pages: 1 2 3 [4] 5 6 ... 9   Go Up