2

I remember the early digital cameras that had anything resembling useful quality (megapixel) stored JPEG files that were noticeably lossy. As memory cards became more capable, this was addressed and manufacturers soon got the compression tuned just right to match the actual useful information from the sensor. After all, whose to say this sample should have been 145 rather than 146? The sampling is a little bit iffy anyway, and the pixels may line up a few nanometers to one side or the other on the scene, right? And a little softening is fine, as the optics are imperfect anyway and a sudden pixel of a different color must be noise anyway. So the JPEG was technically lossy but part of the overall capture pathway and was good enough to capture the meaningful information.

Now, we have 14-bit sensors and much greater depth and color than a normal JPEG file can represent. There is still some inherent softness, whether from DOF or diffraction, since we still have more pixels than image resolving power.

A comment someone made about shooting JPEG to save space got me thinking about how the situation has changed. Saving JPEG is shooting yourself in the foot now, because it is so much less than what the camera captures.

Is there a file format that is lossy but can be tuned to match the inherent information content of the image, that will offer a substantial space savings over RAW files? We can assume that the PC can perform significant processing on the image (not done in-camera) and do things like noise removal first. "soft" (e.g. out of focus background) should naturally give higher compression, without having to pre-identify regions of interest for different parameters. But given that Photoshop can automatically select "in focus" content, it's certainly not out of the question for the processing program to figure out how sharp each region is: that would be good for noise reduction algorithms too, for frequency separation and rejecting noise of higher frequency than expected content.

For burst shots, you could do inter-frame comparisons like video codecs can do. I think there is a new still format for the web based on a single video frame, right? Well, why not a bundle of 3 or 5 nearly identical frames?

JPEG 2000 never took off, and JPEG has more in its arsenal than the JFIF profile we use for common JPEG files. Then there's fancy stuff like Pixar's files.

Is there anything that I can teach people who find RAW files to be "too large" and keep only jpeg? What would be significanly smaller than RAW but (usefully) better than nieve JPEG?

  • 1
    Storing deltas between images seems pointless for stills. What if you delete one or more from the set? Now the deltas will be useless. There are many compression algorithms that are not lossy at all. What is your ultimate goal here? If you're just saying that JPEG isn't the best, then you're right. It just happens to be popular. But then why would you want another lossy format at all? – Octopus Sep 14 '15 at 20:03
  • 1
    There are lossy compressed raw files (with very mild losses). This is NOT a problem to be solved. And it is far from true that "we still have more pixels than image resolving power." You imagine some one for one relationship with pixels and line pairs, but there is none. We are just now reaching the MINIMUM for pixels, just now able to consider possibly removing the anti-aliasing filters (only needed due to insufficient resolving power of the pixels). See scantips.com/lights/reslimit.html – WayneF Sep 14 '15 at 20:46
  • My corresponant said he shoots jpeg because of lackm of space. As I said on the OP, the goal is to substantially reduce the file size while retaining a useful quantity of information. – JDługosz Sep 14 '15 at 22:33
  • Not a problem to be solved: yes, it exists and does not need to be invented? Great. So please give details: what format and how to use it properly? – JDługosz Sep 14 '15 at 22:35
  • You just seek a compressed raw file? I don't know about all cameras, but generally, Raw files are already compressed. I think Canon too, but certainly Nikon. Nikon raw files have a mild lossy compression, but several top end models also offer lossless compression, or a few offer a choice of no compression. Look at a folder of a few dozen of your raw files. Each is a little different size due to compression acting variably on variable content. Uncompressed 12 bit size will be 1.5 bytes per pixel, plus a tiny Exif overhead. Compressed files will be some smaller. DNG also offers compression. – WayneF Sep 15 '15 at 4:20
3

Realistically this is a solved problem and manufacturers have been doing it in similar ways for some time.

Raw files from Canon and Nikon (and probably others too) use a JPEG-Wide variant that is similar to normal JPEG but capable of 16bpc. As it is essentially working on a monochrome image it only has to deal with 1 channel per pixel (and the conversion to RGB is processed later). This is the best place for savings in the workflow as less data in means less data out, plus any compression artefacts will be more likely to show up in the RGB image as a little chroma noise which we tune out quite well.

This means that the problem is not with the OP's correspondent's workflow but with their tooling. Essentially what they've done is bought a sports car and now refuse to drive it fast because of the cost of fuel.

So, if you want to convince them to use raw then you need to show that the value of the extra information in shadows and highlights is worth the extra time/space needed for dealing with the file formats that hold the information. However, if they think the speed is more important to them than ability to work in post then there will be little you can do to change their minds.

2

I'm not convinced a different file format is the best option. That is, if camera manufacturers could include a file format option that retained raw benefits at smaller file sizes, this would be an easy no-brainer: just switch to that format. However, the effort of doing this is on the user. Assuming there is a good file format choice then there's work in getting there:

  • First, you need to ingest the raw file from the camera to the computer. Easy -- this is a solved problem with Lightroom or many other tools.
  • Next, convert to this ideal file format. Likely it can be an automated conversion with some batch processing in Photoshop or some other tool. However, this still takes time to complete and while the CPU is chugging along you may not be able to use the machine for much. In other words, it's likely measurable time that you need to spend to complete this conversion -- in other words, time you or somebody else must pay for, in some way.
  • Manage the old raw file and the new ideal-format file. In your colleague's case this means deleting the raw file and importing the ideal-format file to Lightroom (or whatever their process is so that they can add keywords, edit, etc).

Doing this for a few files or even a whole card's worth isn't a big deal. You've just got a few more simple steps added to your process -- 5 min? 15 min? No problem. But if you incorporate these steps into your workflow permanently take a look at the total cost of effort. Suddenly the total time to do this for, say, a month is an hour; a year is (for arguments sake) 12 hours. No doubt you will also eventually become annoyed with having to convert these files, and needing to pause on the work while the conversion is happening, and then you need to manage these two sets of files.

How much does that 12 hours/year cost? What is your rate (if you do this professionally) or what is your time worth if you do this for fun? Your colleague says he doesn't have enough disk space. A 1 TB external drive can be had for as little as $50. If 1 TB will handle 1 year of shooting, that means the cost of it spread out over the 12 hours is $4.17/hour. I suspect everybody's time is worth more than that.

Of course, an external drive also causes some additional work -- shuffling files over to it -- but I find this easy: monthly I can just move content over to it with a single drag-drop operation.

  • 1
    I suspect manufacturers may not want the extra processing load of a more compact/efficient encoding scheme because of extra CPU load. Wavelets are a good example, efficient output but not computationally cheap (ignoring the many potential patent issues.) – James Snell Sep 15 '15 at 15:21
1

The best modern answer to this question would be the DNG file format.

Keep in mind that there are two major types of compression.

  • Lossy - information is deliberately lost. This will always limit editing to one degree or another.
  • Lossless - information is kept perfectly. This will be equivalent to the original raw file. But the file is smaller than the original.

The default for most programs that create DNG files is to compress the data using lossless compression. I would argue that in the modern world this is the best solution. It minimizes the file size using modern compression techniques AND it maximizes the editing potential of the image.

DNG also has the ability to compress an image using lossy compression. The benefit is that the file can be even smaller than one created via a lossless compression scheme. The downside is that information has been lost forever. This of course impacts editing of the image. DNG's lossy image compression is slightly better than regular jpeg.

  • 1
    Even converting to DNG lossless "bakes in" the black point and white point, and strips the information from a sensor's masked pixels and the maker notes in the EXIF information. Both of these may be used by some applications (just not Adobe applications that ignore some or all of that information) to allow more flexibility and potentially better results when developing a raw image. – Michael C Sep 14 '15 at 22:08
  • By better do you mean quality or size? – JDługosz Sep 14 '15 at 22:38
  • Here is a link to the DNG specification: adobe.com/content/dam/Adobe/en/products/photoshop/pdfs/… . @MichaelClark check out page 14, and you'll see that DNG maintains correct encoding information for black levels even when the masked pixels are left out. Essentially it can remove masked pixels (which makes the file size smaller), do some computations and store the result of those computations. The end result should be the same. – Greg Dietsche Sep 22 '15 at 15:15
  • The end result will only be the same if you further use Adobe products (that set black levels the same way) to edit the images. Other image processing applications do allow the user to use the data from the masked pixels or ignore it and set their own black levels before they are baked in. It's the same thing with the "maker notes" section of the EXIF data. Adobe's applications ignore them, so it make no difference if the are stripped out only as long as you don't try to edit them with an editor that does use that information to improve the end result. – Michael C Sep 22 '15 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.