<commit_before>= Chunky PNG

This library can read and write PNG files. It is written in pure Ruby for
maximum portability. Let me rephrase: it does NOT require RMagick or any other
memory leaking image library.

Source code:: http://github.com/wvanbergen/chunky_png/tree
RDoc:: http://rdoc.info/projects/wvanbergen/chunky_png
Wiki:: http://wiki.github.com/wvanbergen/chunky_png
Issue tracker:: http://github.com/wvanbergen/chunky_png/issues

== Features

* Decodes almost any image that the PNG standard allows, except for images
  that use a different color depth than 8 bits. This includes all standard
  color modes and all transparency, interlacing and filtering options.
* Encodes images supports all color modes (true color, grayscale and indexed)
  and transparency for all these color modes. The best color mode will be
  chosen automatically, based on the image's colors.
* R/W access to the image's pixels.
* R/W access to all image metadata that is stored in chunks.
* Memory efficient (uses a Fixnum, i.e. 4 bytes of memory, per pixel)
* Reasonably fast for Ruby standards, by only using integer math and a highly
  optimized saving routine.
* Interoperability with RMagick.

== Classes

The main classes used within ChunkyPNG are:

<tt>ChunkyPNG::Image</tt> :: create PNG images from scratch or based on another PNG image.
<tt>ChunkyPNG::Datastream</tt> :: low-level read and write access to PNG images from or to a file or stream.
<tt>ChunkyPNG::Canvas</tt> :: represents an image canvas as a matrix of pixels.
<tt>ChunkyPNG::Color</tt> :: represents a, RGBA color

== Usage

  require 'chunky_png'

  # Creating an image from scratch, save as an interlaced PNG
  png = ChunkyPNG::Image.new(16, 16, ChunkyPNG::Color::TRANSPARENT)
  png[1,1] = ChunkyPNG::Color.rgba(10, 20, 30, 128)
  png[2,1] = ChunkyPNG::Color.rgba(0, 0, 0, 128)
  png.save('filename.png', :interlace => true)

  # Compose images using alpha blending.
  avatar = ChunkyPNG::Image.from_file('avatar.png')
  badge  = ChunkyPNG::Image.from_file('no_ie_badge.png')
  avatar.compose(badge, 10, 10)
  avatar.save('composited.png', :fast_rgba) # Force the fast saving routine.
  
  # Accessing metadata
  image = ChunkyPNG::Image.from_file('with_metadata.png')
  puts image.metadata['Title']
  image.metadata['Author'] = '<NAME>'
  image.save('with_metadata.png') # Overwrite
  
  # Low level access to PNG chunks
  png_stream = ChunkyPNG::Datastream.from_file('filename.png')
  png_stream.each_chunk { |chunk| p chunk.type }

(Note: this is subject to change while work is in progress)

== About

The library is written by <NAME> for Floorplanner.com, and released
under the MIT license (see LICENSE). Please contact me for questions or
remarks. Patches are greatly appreciated! :-)

P.S.: The name of this library is intentionally similar to Chunky Bacon and 
Chunky GIF. Use Google if you want to know _why.
<commit_msg>Small README fixes<commit_after>= Chunky PNG

This library can read and write PNG files. It is written in pure Ruby for
maximum portability. Let me rephrase: it does NOT require RMagick or any other
memory leaking image library.

Source code:: http://github.com/wvanbergen/chunky_png/tree
RDoc:: http://rdoc.info/projects/wvanbergen/chunky_png
Wiki:: http://wiki.github.com/wvanbergen/chunky_png
Issue tracker:: http://github.com/wvanbergen/chunky_png/issues

== Features

* Decodes almost any image that the PNG standard allows, except for images
  that use a different color depth than 8 bits. This includes all standard
  color modes and all transparency, interlacing and filtering options.
* Encodes images supports all color modes (true color, grayscale and indexed)
  and transparency for all these color modes. The best color mode will be
  chosen automatically, based on the amount of used colors.
* R/W access to the image's pixels.
* R/W access to all image metadata that is stored in chunks.
* Memory efficient (uses a Fixnum, i.e. 4 bytes of memory, per pixel)
* Reasonably fast for Ruby standards, by only using integer math and a highly
  optimized saving routine.
* Interoperability with RMagick.

== Classes

The main classes and modules used within ChunkyPNG are:

<tt>ChunkyPNG::Image</tt> :: create PNG images from scratch or based on another PNG image.
<tt>ChunkyPNG::Datastream</tt> :: low-level read and write access to PNG images from or to a file or stream.
<tt>ChunkyPNG::Canvas</tt> :: represents an image canvas as a matrix of pixels.
<tt>ChunkyPNG::Color</tt> :: to handle Fixnums as color values.

== Usage

  require 'chunky_png'

  # Creating an image from scratch, save as an interlaced PNG
  png = ChunkyPNG::Image.new(16, 16, ChunkyPNG::Color::TRANSPARENT)
  png[1,1] = ChunkyPNG::Color.rgba(10, 20, 30, 128)
  png[2,1] = ChunkyPNG::Color.rgba(0, 0, 0, 128)
  png.save('filename.png', :interlace => true)

  # Compose images using alpha blending.
  avatar = ChunkyPNG::Image.from_file('avatar.png')
  badge  = ChunkyPNG::Image.from_file('no_ie_badge.png')
  avatar.compose(badge, 10, 10)
  avatar.save('composited.png', :fast_rgba) # Force the fast saving routine.
  
  # Accessing metadata
  image = ChunkyPNG::Image.from_file('with_metadata.png')
  puts image.metadata['Title']
  image.metadata['Author'] = '<NAME>'
  image.save('with_metadata.png') # Overwrite file
  
  # Low level access to PNG chunks
  png_stream = ChunkyPNG::Datastream.from_file('filename.png')
  png_stream.each_chunk { |chunk| p chunk.type }

== About

The library is written by <NAME> for Floorplanner.com, and released
under the MIT license (see LICENSE). Please contact me for questions or
remarks. Patches are greatly appreciated!

P.S.: The name of this library is intentionally similar to Chunky Bacon and 
Chunky GIF. Use Google if you want to know _why. :-)

{'fraction_non_alphanumeric': 0.09591412742382271, 'fraction_numerical': 0.010041551246537396, 'mean_word_length': 4.496669838249287, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7335942', 'n_tokens_mistral': 1914, 'n_tokens_neox': 1802, 'n_words': 684}