     
     static func encode(image: AnyImage, properties: [ImageRep.PropertyKey : Any]) -> Data? {
         
-        var data = MappedBuffer<UInt8>(fileBacked: true)
-        data.encode(TIFFHeader(endianness: .BIG, version: 42, IFD: 8))
-        
         let isOpaque = image.isOpaque
         let samplesPerPixel = isOpaque ? image.colorSpace.numberOfComponents : image.colorSpace.numberOfComponents + 1
         

        
        do {
            
            let colorSpace = photometric == 8 ? AnyColorSpace(.cieLab(white: Point(x: 0.34567, y: 0.35850))) : image.colorSpace
            guard let iccData = colorSpace.iccData else { return nil }
            
            data.encode(TIFFTag.Tag.IccProfile.rawValue.bigEndian)
            data.encode(UInt16(7).bigEndian)
            data.encode(UInt32(iccData.count).bigEndian)

            bitsPerChannel = 16
            
            if photometric == 8 {
                if let image = image.base as? Image<ColorPixel<LabColorModel>>, image.colorSpace == .cieLab(white: Point(x: 0.34567, y: 0.35850)) {
                    pixelData = rawData(image, isOpaque)
                } else {
                    pixelData = rawData(Image<FloatColorPixel<LabColorModel>>(image: image, colorSpace: .cieLab(white: Point(x: 0.34567, y: 0.35850))), isOpaque)
                }
            } else {
                let image = image.base as! TIFFRawRepresentable
