class ChunkyPNG::Palette

def to_plte_chunk

Other tags:
    See: ChunkyPNG::Palette#can_encode? -

Returns:
  • (ChunkyPNG::Chunk::Palette) - The PLTE chunk.

Other tags:
    Note: - A PLTE chunk should only be included if the image is encoded using
def to_plte_chunk
  @encoding_map.clear
  colors = []
  each_with_index do |color, index|
    @encoding_map[color] = index
    colors += ChunkyPNG::Color.to_truecolor_bytes(color)
  end
  ChunkyPNG::Chunk::Palette.new("PLTE", colors.pack("C*"))
end