Class PNG
In: lib/PatchedPNG.rb
Parent: Object

A pure Ruby Portable Network Graphics (PNG) writer.

www.libpng.org/pub/png/spec/1.2/

PNG supports: + 8 bit truecolor PNGs

PNG does not support: + any other color depth + extra data chunks + filters

Example

  require 'png'

  canvas = PNG::Canvas.new 200, 200
  canvas[100, 100] = PNG::Color::Black
  canvas.line 50, 50, 100, 50, PNG::Color::Blue
  png = PNG.new canvas
  png.save 'blah.png'

Methods

chunk   new   raw_bytes   save  

Classes and Modules

Class PNG::Canvas
Class PNG::Color

Public Class methods

Creates a PNG chunk of type type that contains data.

Creates a new PNG object using canvas

Public Instance methods

Writes the PNG to path.

[Validate]