         
         self.withUnsafeMutableBytes {
             
-            guard var destination = $0.baseAddress?.bindMemory(to: R.self, capacity: Pixel.numberOfComponents * $0.count) else { return }
+            guard var dest = $0.baseAddress?.bindMemory(to: R.self, capacity: Pixel.numberOfComponents * $0.count) else { return }
             
             let row = Pixel.numberOfComponents * width
             
-            destination += bitmap.startsRow * row
+            dest += bitmap.startsRow * row
             
             var data = bitmap.data
             
             for _ in bitmap.startsRow..<height {
                 
-                let data_count = min(bitmap.bytesPerRow, data.count) / MemoryLayout<T>.stride
-                guard data_count != 0 else { return }
-                
-                data.popFirst(bitmap.bytesPerRow).withUnsafeBytes { (source: UnsafePointer<T>) in
-                    
-                    let source_end = source + data_count
-                    
-                    var _source = source + channel_idx
-                    var _destination = destination
+                let _length = min(bitmap.bytesPerRow, data.count)
+                guard _length != 0 else { return }
+                
+                data.popFirst(bitmap.bytesPerRow).withUnsafeBytes { (bytes: UnsafePointer<UInt8>) in
+                    
+                    var destination = dest
+                    var source = UnsafeRawPointer(bytes)
+                    let source_end = source + _length
                     
                     var tiff_predictor_record: T = 0
                     
                     for _ in 0..<width {
                         
-                        guard _source + channel_count <= source_end else { return }
-                        
-                        let __destination = _destination + channel.index
+                        guard source + bytesPerPixel <= source_end else { return }
+                        
+                        let _destination = destination + channel.index
+                        let _source = source + byteOffset
                         
                         let _s: T
                         let _d: T
                         
                         switch channel.endianness {
-                        case .big: _s = T(bigEndian: _source.pointee)
-                        case .little: _s = T(littleEndian: _source.pointee)
+                        case .big: _s = T(bigEndian: _source.bindMemory(to: T.self, capacity: 1).pointee)
+                        case .little: _s = T(littleEndian: _source.bindMemory(to: T.self, capacity: 1).pointee)
                         }
                         
                         switch bitmap.tiff_predictor {

        
        precondition(bitmaps.allSatisfy({ $0.channels.allSatisfy { 0...numberOfComponents ~= $0.index } }), "Invalid channel index.")
        
        switch self {
        case let colorSpace as ColorSpace<GrayColorModel>:
            
            if bitmaps.allSatisfy({ $0.bitsPerPixel == $0.channels.count * 8 && $0.isCompact && $0.channels.allSatisfy { $0.format == .unsigned } }) {
                
                var image = Image<Gray16ColorPixel>(width: width, height: height, resolution: resolution, colorSpace: colorSpace, fileBacked: fileBacked)
                
                for bitmap in bitmaps {
                    image._read_compact_pixels(bitmap, is_opaque, UInt8.self)
                }
                
                if premultiplied {

        
        self.withUnsafeMutableBytes {
            
            guard var dest = $0.baseAddress?.bindMemory(to: R.self, capacity: Pixel.numberOfComponents * $0.count) else { return }
            
            let row = Pixel.numberOfComponents * width
            
            dest += bitmap.startsRow * row
            
            var data = bitmap.data
            
            for _ in bitmap.startsRow..<height {
                
                let _length = min(bitmap.bytesPerRow, data.count)
                guard _length != 0 else { return }
                
                data.popFirst(bitmap.bytesPerRow).withUnsafeBytes { (bytes: UnsafePointer<UInt8>) in
                    
                    var destination = dest
                    var source = UnsafeRawPointer(bytes)
                    let source_end = source + _length
                    
                    for _ in 0..<width {
                        
                        guard source + bytesPerPixel <= source_end else { return }
                        
                        let _destination = destination + channel.index
                        let _source = source + byteOffset
                        
                        switch channel.endianness {
                        case .big: _destination.pointee = _denormalized(R(T(bitPattern: T.BitPattern(bigEndian: _source.bindMemory(to: T.BitPattern.self, capacity: 1).pointee))))
                        case .little: _destination.pointee = _denormalized(R(T(bitPattern: T.BitPattern(littleEndian: _source.bindMemory(to: T.BitPattern.self, capacity: 1).pointee))))
                        }
                        
                        source += bytesPerPixel
                        
                        if is_opaque {
                            destination[Pixel.numberOfComponents - 1] = 1
                        }
                        
                        destination += Pixel.numberOfComponents
                    }
                    
                    dest += row
                }
            }
        }
