Sha256: ea47c0d452a02f321558f6d74ab43c3cdef4e69404b0a0ecddc305dd69552e39

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

zpng
======


Description
-----------
A pure ruby PNG file manipulation & validation

Installation
------------
    gem install zpng

Usage
-----

% zpng -h

### Info

% zpng --info qr_rgb.png

### Chunks

% zpng --chunks qr_aux_chunks.png

### ASCII

source image: ![qr_rgb.png](https://github.com/zed-0xff/zpng/raw/master/samples/qr_rgb.png)

% zpng --ascii qr_rgb.png

### Scanlines

% zpng --scanlines qr_rgb.png

### Palette

% zpng --palette qr_plte_bw.png


## Image manipulation

    #!/usr/bin/env ruby
    require 'zpng'
    include ZPNG

    img = Image.new(File.join(File.dirname(__FILE__),"http.png"))

    puts "[.] original:"
    puts img.to_s
    puts

    img.width.times do |x|
      img[x,0] = (x % 2 == 0) ? Color::WHITE : Color::BLACK
    end

    puts "[.] modified:"
    puts img.to_s

    File.open("http-modified.png","wb") do |f|
      f << img.export
    end


License
-------
Released under the MIT License.  See the [LICENSE](https://github.com/zed-0xff/zpng/blob/master/LICENSE.txt) file for further details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zpng-0.0.2 README.md.tpl