 
     # add the actual image data
     @obj.end @imgData
-    
+
     # free memory
     @image = null
     @imgData = null
-    
+
   splitAlphaChannel: ->
     @image.decodePixels (pixels) =>
       colorByteSize = @image.colors * @image.bits / 8


      # build the color space array for the image
      @obj.data['ColorSpace'] = ['Indexed', 'DeviceRGB', (@image.palette.length / 3) - 1, palette]
      
    # For PNG color types 0, 2 and 3, the transparency data is stored in
    # a dedicated PNG chunk.
    if @image.transparency.grayscale

      zlib.deflate alphaChannel, (err, @alphaChannel) =>
        throw err if err
        @finalize()

module.exports = PNGImage
