title: UnsafeMutablePointer<UInt32>.pointee always gives the same value while reading an image in swift 3
body: <p>i have the following code, i am trying to ready the image i have in order to define where is the white pixels, transparent and so on, but my output always is 255 ( if (pointer.pointee >> 24) == 255) so it is telling me that it is all black, while it's not!
  any help?</p>
  
  <pre><code>    var colorSpace = CGColorSpaceCreateDeviceRGB()
      let imageCG = image.cgImage!
      imageWidth = imageCG.width
      imageHeight = imageCG.height
      imageScale = image.scale
      totalPixels = imageHeight * imageWidth
  
      var bitsPerComponent = 8
      var bytesPerRow = 4 * imageWidth
      var bitmapInfo = CGBitmapInfo.byteOrder32Little.rawValue | CGImageAlphaInfo.premultipliedFirst.rawValue
  
      // Init imageContext
      imageContext = CGContext(data: nil, width: imageWidth, height: imageHeight, bitsPerComponent: bitsPerComponen`enter code here`t, bytesPerRow: bytesPerRow, space: colorSpace, bitmapInfo: bitmapInfo)!
      imageContext.draw(imageCG, in: CGRect(x: 0, y: 0, width: imageWidth, height: imageHeight))
  
  
      // Init imageData
  
      imageData = imageContext.data!.bindMemory(to: UInt32.self, capacity: totalPixels)
  
      // Init regionsData
      regionsData = UnsafeMutablePointer&lt;UInt16&gt;.allocate(capacity: totalPixels)
  
      var regionsPointer: UnsafeMutablePointer&lt;UInt16&gt; = regionsData
      var pointer: UnsafeMutablePointer&lt;UInt32&gt; = imageData
  
      // Scan image data and mark full transparent, semitransparent and opaque pixels in regions data
  
      let minAlpha = UInt32(255 - transparencyTolerance)
  
      for _ in 0..&lt;totalPixels {
          if (pointer.pointee &gt;&gt; 24) == 255 {
              regionsPointer.pointee = regionsBlackColor
          } else if (pointer.pointee &gt;&gt; 24) &gt; minAlpha {
              regionsPointer.pointee = regionsTransparentColor
          } else {
              regionsPointer.pointee = regionsWhiteColor
          }
          pointer.pointee = whiteColor
          pointer = pointer.successor()
          regionsPointer = regionsPointer.successor()
      }
  </code></pre>