wvanbergen edited this page Sep 23, 2011 · 22 revisions

Changes to ChunkyPNG over the subsequent versions since version 0.5.0:

Version 1.2.5

  • Edge case bugfix in Color.decompose_alpha_component that could get triggered in the change_theme_color! method.

Version 1.2.4

  • Added data URL importing Canvas.from_data_url.

Version 1.2.3

  • Added data URL exporting Canvas#to_data_url to easily use PNGs inline in CSS or HTML.

Version 1.2.2

  • Workaround for performance bug in REE.

Version 1.2.1

  • Added bicubic resampling of images.

  • Update resampling code to use integer math instead of floating points.

Version 1.2.0

  • Properly read PNG files with a tRNS chunk in color mode 0 (grayscale) or 2 (true color).

Version 1.1.2

  • Added Color.to_grayscale and Canvas#grayscale! to convert colors and canvases to grayscale.

  • Memory footprint improvement of Canvas#resample!

Version 1.1.1

  • Added Canvas#to_alpha_channel_bytes and Canvas#to_grayscale_stream to export raw pixel data.

  • Spec suite cleanup

Version 1.1.0

  • Add bezier curve drawing: Canvas#bezier_curve.

  • RDoc fixes & improvements.

Version 1.0.1

  • Performance improvements.

Version 1.0.0

Note: the are some API changes for this release. If you are using Canvas#compose or Canvas#replace, these methods will no longer operate in place, but will return a new canvas instance instead. The in place versions have been renamed to compose! and replace! to be more consistent with the rest of the API.

  • Added image resampling using the nearest neighbor algorithm: Canvas#resample.

  • Added circle and polygon drawing methods: Canvas#circle and Canvas#polygon.

  • Added in place version of Canvas#crop, Canvas#rotate_180, Canvas#flip_horizontally and Canvas#flip_vertically. Just add a bang to the method name (e.g. Canvas#crop!) and it will change the current canvas instead of returning a new one. These implementations are also more memory and CPU efficient.

  • Added geometry helper classes: ChunkyPNG::Point, ChunkyPNG::Dimension and ChunkyPNG::Vector.

  • Added a list of HTML named colors. Get them by calling ChunkyPNG::Color(:teal) or ChunkyPNG::Color('red @ 0.8')

  • Added encoding support for 1-, 2-, and 4-bit grayscale images.

  • Cleaned up auto-detection of color mode settings. It will now choose 1 bit grayscale mode if an image only contains black and white. (The other low bitrate grayscale modes are never chosen automatically.)

  • RDoc improvements. See

  • ChunkyPNG is now also tested on Ruby 1.8.6.

Version 0.12.0

  • Added support for encoding indexed images with a low bitrate. It will automatically use less bits per pixel if possible.

  • Improved testing setup. ChunkyPNG is now tested on Ruby 1.8.7, 1.9.2, JRuby and Rubinius.

Version 0.11.0

  • Decoding of 1, 2 and 4 bit indexed color images.

  • Decoding of 1, 2 and 4 bit grayscale images.

  • Decoding 16 bit images. The extra bits will be discarded, so the image will be loaded as 8 bit.

  • Used the official PNG suite to build a more complete test suite.

Version 0.10.5

  • Bugfix: allow 256 instead of 255 colors for indexed images.

Version 0.10.4

  • Improved handling of binary encoding for strings in Ruby 1.9.

Version 0.10.3

  • Small fix to make grayscale use the B byte consistently.

Version 0.10.2

  • Another small fix for OilyPNG compatibility

Version 0.10.1

  • Small fix for OilyPNG compatibility

Version 0.10.0

  • Refactored decoding and encoding to work on binary strings instead of arrays of integers. This gives a nice speedup and uses less memory. Thanks to Yehuda Katz for the idea.

Version 0.9.2

  • Fixed an issue with interlaced images.

Version 0.9.1

  • Fixed image metadata issue when duplicating images.

Version 0.9.0

  • Added flip_horizontally, flip_vertically, rotate_left, rotate_right and rotate_180 to ChunkyPNG::Canvas.

  • Now raises ChunkyPNG::OutOfBounds exceptions when referencing coordinates outside the image bounds.

  • Added Gemfile for development dependency management.

Version 0.8.0

  • Added ChunkyPNG::Image#rect to draw simple rectangles.

  • Fixed composing a transparent color on a fully transparent background.

Version 0.7.3

  • Based on the suggestion of Dirkjan Bussink (Github:, introduced custom exception classes:

    • ChunkyPNG::SignatureMismatch is raised when the PNG signature could not be found. Usually this means the the file is not a PNG image.

    • ChunkyPNG::CRCMismatch is raised when the a CRC check for a chunk in the PNG file fails.

    • ChunkyPNG::NotSupported is raised when the PNG image uses a feature that ChunkyPNG does not support.

    • ChunkyPNG::ExpectationFailed is raised when a required expectation failed.

Version 0.7.2 was yanked

Version 0.7.1

  • Some fixes for 32-bit systems.

Version 0.7.0

  • Added :best_compression saving routine to allow creating the smallest images possible.

  • Added option to control Zlib compression level while saving.

Version 0.6.0

  • Added methods to easily create different color variants of an image with a color theme. See Images with a color theme for more information.

Version 0.5.8

  • Ruby 1.8.6 compatibility fixes

  • Improved API documentation.

Version 0.5.5

  • Added alpha decomposition to extract a color mask from a themed image.

  • Improved API documentation.

Version 0.5.4

  • Added point and line anti-aliased drawing functions.

Version 0.5.3

  • Removed last occurrences of floating math to speed up the library.

  • Added importing of ABGR and BGR streams.

  • Added exporting an image as ABGR stream.

Version 0.5.2

  • Ruby 1.9 compatibility fixes.

  • Improved speed of PNG decoding.

  • Bugfix in average scanline decoding filter.

Version 0.5.1

  • Added :fast_rgba and :fast_rgb saving routines, which yield a 1500% speedup when saving an image.

Version 0.5.0

  • Complete rewrite of the earlier versions, now including awesomeness and unicorns.