Showing posts with label file-format. Show all posts
Showing posts with label file-format. Show all posts

Thursday, May 10, 2012

Why isn't saving photos as TIFF files a popular choice by DSLR manufacturers?

Question

Why do many DSLRs have the option to save in RAW or JPEG but not in TIFF? It would be useful to save it as a TIFF file using lossless compression. It would be a midway between RAW and JPEG. Is it because the size of TIFF files is huge?

Asked by Akram Mellice

Answer

Noting other answers, and having had a bridge camera that did TIFFs, I'd suggest that for DSLRs TIFF is pointless except as an add on if it can be managed.

TIFF is a lossless way of saving an image, once an image is generated, BUT the image that it saves is an interpretation of what the sensor records.

RAW gives you the maximum possible flexibility in dealing with the available data. Software to convert to TIFF or JPG is provided by the camera maker plus the various commercial RAW converters are a small fraction of a good DSLR price.

JPG gives you user usable images at a compression level that suits the user.

RAW + JPG gives you all the advantages of RAW plus some of the advantages of JPG (as it usually does not allow selection of JPG compression level and the JPG provided may be not be the highest quality JPG the camera provides in pure JPG mode.
eg in a Sony A700, straight JPG comes in Extra Fine, Fine, Standard.
But with RAW + JPG, the provided JPG is "fine" and not "Extra Fine".

TIFF loses data relative to RAW and is far larger than any sensible JPG and has no great quality improvement over the best JPG. Once it is "not RAW" then it is subject to manufacturers decisions.

Useful where available is Compressed-RAW and Compressed RAW + JPG.
Available eg on Sony A700 but not on the newer A77 where it would be useful due to largr file sizes.
Compressed-RAW provides a lossless compression of the RAW file at the expense of processing time and a somewhat non-stanard format.

Answered by Russell McMahon

Tuesday, March 6, 2012

How can I work around Photoshop Elements 7's inability to open JPG files from my Android phone?

Question

I copied some photographs that I took with my Android phone to my laptop. When I tried to open them with Photoshop Elements 7.0, I received the following error message:

Could not complete your request because reading spatial lossless jpeg files is not implemented.

Is there a workaround for Photoshop Elements 7.0? If I upgraded to the latest version would it work then?

This question was previously asked at the Adobe forums with no responses currently.

Asked by Gdalya

Answer

The problem seems to be that I set up my phone to encrypt my SD card and when I pulled files to my PC, they came off still encrypted. A fuller discussion of this issue can be found on Android Enthusiasts Stack Exchange.

Answered by Gdalya

Friday, February 10, 2012

What are compressed image formats with high quality/size ratio?

Question

I'm looking for an image format, unpopular as it may be, that has good quality and also good compression. After I'm done post-processing my RAWs I want to export them in a way that's shareable and practical, trying to save as much space as possible. PNG seems too heavy and JPG is quite lossy.

Asked by the.midget

Answer

It depends on what you mean by "shareable" and "practical". Are you sending your images to the web, a printer, or just your own storage solution? The only practical format for the web is JPEG. If you are sending to a printer you can probably chose between TIFF, JPEG, and PSD. If you are just storing it yourself, you could use PSD, PNG, TIFF, JPEG, DNG, or your native RAW format.

Practically speaking, JPEG is great quality and sharable so there is not a real need for anything beyond that at this time. See my previous post on JPEG 2000.

Answered by dpollitt

Friday, February 3, 2012

Why don't cameras support JPEG 2000 format?

Question

The original JPEG format was updated in 2000 to provide a variety of features including less artifacts, better compression and lossless compression. Why haven't cameras updated to use this new format?

Answer

JPEG 2000 has not garnered wide acceptance due to a few factors.

  • Lacking backwards compatibility to JPEG
  • Lack of wide browser support
  • Questionable legal status
  • (Only) 20% higher performance, while considering how inexpensive storage is
  • Additional processing power/time needed to create
  • JPEG already considered quite good
  • Amount of rework to the code in cameras and desktop software is high

Tuesday, January 17, 2012

Should I care about jpeg2000 (and does anyone else)?

Question

I know the question is a bit subjective, what I'm after is if there is enough improvement in jpeg2000 and enough support in software (image viewers, browsers) to warrant using it.

Answer

I will respond by referencing the reasons for defining the JPEG2000 specification in the first place, which, when you read it, will explain why you don't see or hear about it:

JPEG 2000 images have a number of properties which make them very suitable for use with the Internet. Typically, Internet users are constrained from downloading large, high quality images because of their physical file size. Often providers of images must create three or more versions of an image, varying from a tiny thumbnail through to a page size image.

Digital cameras have improved in quality and resolution to a level where they are now competing effectively with traditional film. The images they generate are often no longer directly suitable for Internet deployment - the quality and size is wasted on traditional computer monitors. In part, this is because the monitor might show no more than a quarter of the captured image without scrolling, and in part because the colour fidelity of the monitor does not match that of the camera.

So, JPEG2000 was created to improve image download time, and the fact that digital images were getting larger. Now, while we still need to care about optimizing JPEG for web viewing, and something like JPEG2000 would be nice, times have changed. I think this is dated thinking, as the expansion of broadband, dynamic image loading of JPEG and auto-sizing found in sites like Flickr and Smugmug to name two, have really eliminated these issues. Rarely do you run into an issue where a DSLR JPEG is 'too big' to show on a screen. Not to mention that screens are higher resolution and much larger than they were in 1999, when the specification was proposed.

This was made a standard in 2000, and is supported by most browsers, but I suspect it isn't used because it doesn't solve any problems.

I think no one cares. Note that JPEG XR/HD Photo have been created since, and no one seems to care about them either, not even Microsoft, who hasn't updated their HD Photo spec or info since 2006.

Tuesday, December 27, 2011

How many different RAW formats are there?

Question

All major manufacturers seem to have their own raw file format. How many of them are? Do they all have similar information? Is there any standard?

Answer

There are a lot of different RAW file formats, not compatible with each other. The Wikipedia page has a list of them. Some manufacturers have used more than one format.

There are some things they tend to have in common.

Most of them are based on the TIFF file format. The TIFF file format can contain various types of image data and metadata, and it has been adapted by camera manufacturers to carry the raw sensor data from the camera sensor.

Almost all modern sensors use the same RGGB Bayer interpolation matrix. While some may read in 12-bit and some in higher bit depths, the layout is the same. This is often also compressed using a common type of lossless data compression.

RAW files almost always contain a low-bitrate, large JPEG image stream allowing for fast previewing on the camera LCD, but with the ability to zoom in on detail too. This is in addition to a small thumbnail in many cases.

RAW files need to preserve the same metadata streams as the camera would need to create the equivalent JPEG - this means EXIF/XMP data.

The proliferation of mutually incompatible formats has led for the push to standardise, and the DNG format owned by Adobe is one attempt at creating a (comparatively) open, manufacturer-agnostic format that can be shared. However, the effectiveness of such a format is only as good as the manufacturers' support for it. Some cameras do support the DNG format directly, but they are as yet in the minority. In the meantime, open source code for reading virtually any RAW format is readily available, even though RAW files tend to include some encrypted data.

Lots more information about RAW formats is available on the Wikipedia page so I'd recommend it.

Wednesday, December 14, 2011

How can I convert a proprietary raw image format to Adobe DNG?

Question

I have a proprietary raw camera image format taken from a Aptina camera.

Its raw file format is 16bit per color channel, 'GRBG' mode with file extension .raw. No headers, nothing, just plan raw bayer samples. I want to convert this format to DNG, as none of the raw image decoders (dcraw, gimp, …) seem to support it.

  1. Is there any tool/converter which can handle Aptina camera sensor raw bayer format, and allow me to convert it to DNG format?

  2. If not, I want to write a small C code to convert it myself. Where can I find the detailed specification about DNG format, its structure etc.? Any document explaining all this DNG format?

Answer

DNG files are based on the TIFF/EP standard, ISO 12234-2, (they're essentially bitmaps with extra metadata) so if you start out with an appropriate TIFF I/O library that will get you part way, but you'll need to fill in the extra data required by DNG, which could be tricky.

Raw converters need to know more than just the pixel intensities. Other relevant information includes pixel shape and orientation, or the properties of the dyes (just knowing they go GRBG is not enough, you may need to know the precise shade (or more accurately the frequency response) of each dye to create the colour representation as this varies between manufacturers). I think DNGs handle this by means of an embedded "camera profile".

edit:

There's an open source photo management application called digiKam which can write DNG files, so your best bet would probably be to look through their source and try and rip out the DNG encoding functions.

Thursday, November 17, 2011

What is a reasonable file format for film scanning?

Question

I'm looking to use my CanoScan 8600F to digitally archive the photos I've shot on film.

The issue I've stumbled on is deciding on a file format. Ideally I'd like something that is lossless but with some reasonable compression.

So far I've tried (over the last few years):

TIFF - File sizes seem to be pretty big

JPEG2000 - Photoshop elements 4 supported it, but doesn't seem to have a lot of support else where

DNG - Not sure if this is an option for scanning

I'm also looking for some guidance on resolutions to scan at... this was asked in another question "What to consider when scanning 35mm film (and scanning in general)" but wasn't directly answered, other than to say that scanners were only optically capable of 1500dpi.

With some exceptions I don't expect to make prints other than maybe 4x6s.

I currently use Adobe Lightroom with my DSLR and my new laptop included Photoshop Elements 9, but I haven't used PE9 yet.

Answer

I would say TIFF is probably the best format. JPEG 2000, like JPEG, is still a lossy compressed format when you really try to save space (the lossless version can compress a bit, but not nearly as much as the lossy form, and some forms of the "lossless" wavelet compression still can't fully reproduce the exact original image.)

When scanning in an original or master image, it's really best to maintain as much image detail and color depth as you can, and TIFF is an ideal format for this. It is guaranteed to be lossless, supports a wide variety of color depths including high color depths, has very broad support across many applications on multiple platforms, and even supports layers and other advanced objects that can be created with applications like Photoshop. TIFF also supports the storage of metadata, like JPEG.

I am not sure if DNG is an option for directly scanning film, and even if it was, I am not sure what the benefit of using DNG over TIFF for a film scan is. DNG has more merit in the digital RAW workflow, as it supports storing native camera RAW data and metadata, which really wouldn't be of much use for a film scan (which is always going to result in RGB pixels anyway.)

Regarding resolution, I guess it might depend on the nature of the film. If you are scanning very grainy film, you might not need to scan at an extremely high resolution, however scanning at too low of a resolution will likely even interfere with grain detail (which does have an aesthetic appeal to many, and that aesthetic might be diminished at too low of a resolution... and I would consider 1500dpi to be fairly low these days.) I'm a digital photographer, however I have researched film quite a bit as I have a strong interest in large format. To my understanding, a low-speed, fine-grain film like Velvia 50 is easily capable of over 3000dpi, which is double the dpi mentioned in the article you have linked. I have done some 35mm negative scans of old film just for kicks, and scanning up to 4800dpi (the maximum optical native of my scanner) produces an astonishing amount of fine detail. I would say scan at the highest resolution you can so long as you don't see negative returns, and I wouldn't be surprised if 4800dpi or even as much as 6000dpi was necessary to extract all the detail from your film.

If the initial file size worries you, you can always downscale your master file a bit from a high resolution scan, which should help improve sharpness a bit while also saving a little disk space. High-ISO black and white film will generally require less DPI, however keep in mind that film grain is not ubiquitous in size and distribution, and the full quality and shape of a single grain may require many pixels to render fully.

Monday, October 10, 2011

Do I lose anything converting to DNG?

Question

I'd like to convert all my ARW (Sony) files to DNG for several reasons, but the only thing keeping me back from doing it is the fear of losing useful metadata during the conversion. I know that the image it's self is completely safe during the conversion but what about proprietary maker noteS? Will those stay too? And even if they do, are they actually useful and can be actually used by something other then Sony's own RAW converter?

P.S. I'm using Ubuntu so I'd prefer to use KipiPlugins' DNG converter because from what I understand it does everything the Adobe converter does, but if I'm wrong I can use Adobe's instead.

EDIT:

It looks like the LensID does carry over! With the ARW and the DNG files converted by Kipiplugins' built in converter, info is stored as "Exif.Sony.0x___". With Adobe's official converter, it moves the info to more logically named fields in the XMP, such as "LensID" and "Lens".

Now that I've figured it out, I think I might use Adobe's Official converter, just because I prefer how it reorganizes the Exif Data.

I'm not fully convinced though and I'd like to hear others take on all this.

Answer

Your answer can be found at this forum site, but the short is, you will lose some EXIF information, the lens id in particular, but the normal EXIF will be there (IE, aperture, focal length, exposure time, flash firing).

Thursday, July 14, 2011

What's the difference between PEF and DNG RAW formats?

Question

I just recently purchased a Pentax K-r. It has two formats to shoot raw with, PEF and DNG. Are there advantages or disadvantages with using one over the other?

Answer

PEF is Pentax's proprietary RAW format. DNG is the semi-standard owned by and promoted by Adobe.

In reality, there's no practical difference. They both hold the same information. It seems like there might be an advantage in having a standard format, but as a practical matter, RAW converter software needs to be updated with information for each camera anyway, and so DNG doesn't really add much. And pretty much all software that supports Pentax cameras via DNG can also read PEF files.

In older Pentax models, PEF could be (losslessly) compressed and DNG was always uncompressed. In modern cameras, they're both compressed.

How do I make sure my RAW files are readable in the future?

Question

I've recently started to use RAW with Lightroom. I'd like opinions on how I should make sure my images are readable (not necessarily editable) a few years hence. Heck, let's say a decade some decades.

Should I keep my archives in Nikon's raw format, in conjunction with the LR database? Should I convert them to TIFF? How about DNG?

Answer

Having finished scanning 40 year old film I can assure you that you need to think longer term than 10 years, in fact at least 40 years.

To know whether there is an answer one must understand the problem. These things can happen:

  1. proprietary software makers stop supporting old formats, very possible after 40 years.
  2. proprietary operating systems stop supporting old photographic programs, also very possible after 40 years.
  3. a copy of the 40 year old proprietary operating system will no longer run on current hardware, highly probable.

So, there is a real possibility that in 40 years time you will no longer be able to read your RAW images, using proprietary software. This is not to criticise proprietary software makers. Their shareholders require them to generate profits and growth which can be incompatible with maintaining decades old software.

Can anything be done?

  1. store your images as DNG. Support is coalescing around this format, making it rather more likely to survive over the long term.
  2. store a copy as a high res jpeg. This will be readable for a long time.
  3. keep a copy of your operating system and programs in a virtual machine. For example, for other reasons, I keep a copy of Windows 98 in a virtual box, allowing me to run it under more recent operating systems, on more recent hardware.

But, because I am involved in the open source world, I am confident there will always be an open source solution. I say this because:

  1. it is a requirement of the GPL licence to keep the source code available. This means you can always locate the relevant program and recompile it to run in the current environment (or somebody else will do it).
  2. there is an army of open source programmers who delight in supporting even the quaintest and most esoteric things. An example of this is that, right now, Linux supports a wider variety of hardware devices than MS Windows.
  3. open source programmers are very active in supporting the various RAW formats.

You may remember the Commodore 64. It was introduced in Jan 1982, 28 years ago, but was quickly obsoleted by the then new IBM PC. But even today you can run programs for that machine thanks to the Commodore 64 emulators developed and maintained by the open source world. This is evidence that we will be able to depend on open source solutions for a long time.

Tuesday, July 12, 2011

Is TIFF really of higher quality than PNG-24?

Question

I've been doing some research to try to figure out why more people do not store high-resolution image files as PNG-24. PNG has exactly-reversible, lossless compression, it is a net-friendly format so any web browser can view it, and it supports full transparency.

I've seen several people say that TIFF has a "higher quality" than PNG, but no one provides any details on exactly how it is of higher quality. PNG-24 is lossless, so when you "Save As" a TIFF to a PNG, how exactly are you losing quality?

Answer

You explicitly mentioned PNG-24 - that has eight bits per channel, whereas a TIFF file can have 16. That would be one reason the quality could be higher, from a RAW conversion especially but also if you are doing a lot of editing.

The PNG standard also supports 16-bits per channel (PNG-48) but I don't know how many applications support that, whereas pretty much anything that can read TIFF is going to be able to read a 16-bit TIFF file.

TIFF can also store layers in it, which is not a quality issue so much as a flexibility thing. PNG is really meant to hold an image, not a layered set (although APNG can hold a set, it's really not for the same purpose).

Monday, July 11, 2011

Should I save an image as png, jpeg or bmp?

Question

If I edit an image file using some application like Gimp, Photoshop or MSPaint, while saving I will be asked to select the required file-format. There are different formats available, the common ones are jpg, png and bmp. Other less common options are gif and tiff.

So which option should I select? What are the merits and demerits of using a particular file format?

Answer

JPEG is lossy, which means it compresses the image (in part) by discarding data. The data it discards is (normally) chosen to minimize the affect on the quality of the image, but it (virtually) always loses at least a little quality -- and depending on the quality level you choose, it can lose quite a bit. For most photographs it should be considered a display-only format -- once you've converted something to JPEG, you don't want to do any more editing on it. If you need to make changes, you re-start from some other format, make the changes, and do another JPEG conversion.

GIF uses only lossless compression, but is limited to 8-bit (256) colors, which is quite limiting for photographs.

PNG was designed as a replacement for GIF, and mostly succeeds. It supports 24-bit color (8 bits each for red, green, and blue) and uses lossless compression.

TIFF is really a container format that allows you to insert various kinds of data into the container. While it's used primarily for images, it's really almost like a file system, so you could theoretically use it for almost any kind of data. This has a couple of consequences. One is that even if a program supports TIFF files, it may not support all TIFF files -- e.g., many don't support LZW-compressed images. In fact, few programs support all possible TIFF files. Another consequence is that TIFF tends to have a fair amount of overhead, and writing code to support TIFF (at all well) is a pain (which is why so many programs support it only incompletely).

BMP is basically just a Windows device independent bitmap written out to disk. It has only extremely limited support for compression (and most BMPs aren't compressed at all). Programs written for Windows can read/write BMP really easily, but there's not much else to recommend it (in particular, BMP files tend to be quite large for the amount of data being stored).

Conclusion: JPEG is useful as an output format (e.g., to display things on web pages it's good because it's compact, and virtually everybody can read it).

As an intermediate format that you might use (for example) to store a file that might later be edited, TIFF is about the only one of these that's really of much use.

The others (GIF, PNG, BMP) aren't really of much use for photographs.