APNG Specification: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 118: Line 118:
* `APNG_RENDER_OP_DISPOSE_PREVIOUS`: the frame's region is to be reverted to the previous contents.
* `APNG_RENDER_OP_DISPOSE_PREVIOUS`: the frame's region is to be reverted to the previous contents.


`APNG_RENDER_OP_BLEND_FLAG` may be added to any of the above disposal operations.  If this flag is 0, all color components of the frame, including alpha, overwrite the current contents of the frame's canvas region.  If the APNG_RENDER_OP_BLEND_FLAG is not 0 the frame should be composited onto the canvas based on its alpha, using a simple OVER operation:
`APNG_RENDER_OP_BLEND_FLAG` may be added to any of the above disposal operations.  If this flag is 0, all color components of the frame, including alpha, overwrite the current contents of the frame's canvas region.  If the APNG_RENDER_OP_BLEND_FLAG is not 0 the frame should be composited onto the canvas based on its alpha, using a simple OVER operation as described in the "Alpha Channel Processing" section of the PNG specification [pngspec].
 
    Csrc - component of pixel in the frame
    Asrc - alpha component of a pixel in the frame
    Cdst - component of pixel in the canvas region
    C - resulting component value to be rendered in the canvas region
   
    C = Csrc * Asrc + Cdst * (1 - Asrc)


`APNG_RENDER_OP_BLEND_FLAG` is not valid for color types 0 (greyscale without alpha) or 2 (truecolor without alpha).  It is valid for type 3 (indexed) images; however, the resulting pixel values may not be present in the specified palette.  It is always valid for type 4 (greyscale with alpha) and type 6 (truecolor with alpha) images.
`APNG_RENDER_OP_BLEND_FLAG` is not valid for color types 0 (greyscale without alpha) or 2 (truecolor without alpha).  It is valid for type 3 (indexed) images; however, the resulting pixel values may not be present in the specified palette.  It is always valid for type 4 (greyscale with alpha) and type 6 (truecolor with alpha) images.
Line 135: Line 128:
The `fdAt` chunk has the same purpose as an `IDAT` chunk. It has the same data structure as an `IDAT` chunk, except a sequence number is appended in the beginning.
The `fdAt` chunk has the same purpose as an `IDAT` chunk. It has the same data structure as an `IDAT` chunk, except a sequence number is appended in the beginning.


There may be multiple `fdAt` chunks for any one frame; if so, they shall appear consecutively with no other intervening chunks. The compressed datastream is then the concatenation of the contents of the data fields of all the `fdAt` chunks.
Each frame must contain at least one fDAt chunk. There may be multiple `fdAt` chunks for any one frame; if so, they shall appear consecutively with no other intervening chunks. The compressed datastream is then the concatenation of the contents of the data fields of all the fDAt chunks within a frame.  When decompressed, the datastream is a complete PNG image, including the filter byte at the beginning of each scanline.
 
It utilizes the same bit depth, color type, compression method, filter
method, interlace method, and palette (if any) as the main image.


Format:
Format:
48

edits

Navigation menu