Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: .NEF image format in Import

  • To: mathgroup at
  • Subject: [mg90202] Re: .NEF image format in Import
  • From: David Reiss <dbreiss at>
  • Date: Wed, 2 Jul 2008 05:29:57 -0400 (EDT)
  • References: <g4d2qq$en1$>

HI Andrew,

There is no NEF import for Mathematica at this time.  The list of
import formats is given by


and gives the list

{"3DS", "ACO", "AIFF", "ApacheLog", "AU", "AVI", "Base64", "Binary", \
"Bit", "BMP", "Byte", "BYU", "BZIP2", "CDED", "CDF", "Character16", \
"Character8", "Complex128", "Complex256", "Complex64", "CSV", "CUR", \
"DBF", "DICOM", "DIF", "Directory", "DXF", "EDF", "ExpressionML", \
"FASTA", "FITS", "FLAC", "GIF", "Graph6", "GTOPO30", "GZIP", \
"HarwellBoeing", "HDF", "HDF5", "HTML", "ICO", "Integer128", \
"Integer16", "Integer24", "Integer32", "Integer64", "Integer8", \
"JPEG", "JPEG2000", "JVX", "LaTeX", "List", "LWO", "MAT", "MathML", \
"MBOX", "MDB", "MGF", "MOL", "MPS", "MTP", "MTX", "MX", "NB", \
"NetCDF", "NOFF", "OBJ", "ODS", "OFF", "Package", "PBM", "PCX", \
"PDB", "PDF", "PGM", "PLY", "PNG", "PNM", "PPM", "PXR", "QuickTime", \
"RawBitmap", "Real128", "Real32", "Real64", "RIB", "RSS", "RTF", \
"SCT", "SDTS", "SND", "Sparse6", "STL", "String", "SXC", "Table", \
"TAR", "TerminatedString", "Text", "TGA", "TIFF", "TSV", \
"UnsignedInteger128", "UnsignedInteger16", "UnsignedInteger24", \
"UnsignedInteger32", "UnsignedInteger64", "UnsignedInteger8", \
"USGSDEM", "UUE", "VCF", "WAV", "Wave64", "WDX", "XBM", "XHTML", \
"XHTMLMathML", "XLS", "XML", "XPORT", "XYZ", "ZIP"}

Since you didn't specify the import format explicitly in your command,
I suspect that Mathematica is looking at the file and finding a jpeg
specification for the thumbnail at the beginning of the file and then
trying to do its best from there.

If you were to write


to explicitly tell Mathematica the format to try to read, you will get
$Failed as an output.

You can, however, get information on what can be read from the file by
looking for its "Elements" as in

Import["/Users/dreiss/Photos/SW_1_20_08/Card 1/_DSC0111.NEF", \

which, in my case here, gave

{"Animation", "Author", "BitDepth", "CameraTopOrientation", \
"ColorMap", "ColorSpace", "Comments", "CopyrightNotice", "Data", \
"DataType", "Device", "DeviceManufacturer", "Frames", "Graphics", \
"GrayLevels", "ImageCreationDate", "ImageEncoding", \
"ImageResolution", "ImageSize", "RawData", "RGBColorArray"}

And then these can be used to extract explicit parts of the data that
Mathematica is able to access from the file as in,

In[27]:= Import["/Users/dreiss/Photos/SW_1_20_08/Card \
1/_DSC0111.NEF", "DeviceManufacturer"]


I hope that this helps...
A WorkLife FrameWork
E x t e n d i n g MATHEMATICA's Reach...
Trial Version at:

On Jul 1, 7:01 am, Andrew Watson <andrew.b.wat... at> wrote:
> I am trying to import an image in raw format from a digital camera.  
> The format name is .NEF , developed by Nikon.
> The command
>         test = Import["image.NEF"]
> works, but the image acquired is {120,160} in dimensions, rather than  
> the true {2000, 3008}.
> I suspect it is importing a small jpeg preview, instead of the full  
> image.
> Any ideas how to import the full image, and whether .NEF is supported?
> Andrew B. Watson
> Senior Scientist for Vision Research
> NASA Ames Research Center
> Moffett Field, CA 94035-1000
> (650) 604-5419

  • Prev by Date: Re: Possible Bug in Mathematica 6
  • Next by Date: RE: Possible Bug in Mathematica 6
  • Previous by thread: Re: .NEF image format in Import
  • Next by thread: Re: Ticks question