diff --git a/examples/raw2dng.py b/examples/raw2dng.py index 79dcbd5..6210869 100644 --- a/examples/raw2dng.py +++ b/examples/raw2dng.py @@ -10,7 +10,7 @@ # load raw data into 16-bit numpy array. numPixels = width*height -rawFile = 'extras/scene_daylight_211ms_c2.raw16' +rawFile = '../extras/scene_daylight_211ms_c2.raw16' rf = open(rawFile, mode='rb') rawData = struct.unpack("H"*numPixels,rf.read(2*numPixels)) rawFlatImage = np.zeros(numPixels, dtype=np.uint16) @@ -27,8 +27,7 @@ t = DNGTags() t.set(Tag.ImageWidth, width) t.set(Tag.ImageLength, height) -t.set(Tag.TileWidth, width) -t.set(Tag.TileLength, height) +t.set(Tag.RowsPerStrip, height) t.set(Tag.Orientation, Orientation.Horizontal) t.set(Tag.PhotometricInterpretation, PhotometricInterpretation.Color_Filter_Array) t.set(Tag.SamplesPerPixel, 1) @@ -43,11 +42,8 @@ t.set(Tag.BaselineExposure, [[-150,100]]) t.set(Tag.Make, "Camera Brand") t.set(Tag.Model, "Camera Model") -t.set(Tag.DNGVersion, DNGVersion.V1_4) -t.set(Tag.DNGBackwardVersion, DNGVersion.V1_2) -t.set(Tag.PreviewColorSpace, PreviewColorSpace.sRGB) # save to dng file. r = RAW2DNG() -r.options(t, path="", compress=True) -r.convert(rawImage, filename="custom") \ No newline at end of file +r.options(t, path="", compress=False) +r.convert(rawImage, filename="custom")