StumpyPNG/GIF

Keywords: crystal
Created: 2019-07-22 Mon 20:15:44
Table of Contents

StumpyPNG

Crystal library for reading and writing png files, with support for Adam7 interlacing and all kinds of color types.

Source code on Github: stumpycr/stumpy png

include StumpyPNG

canvas = Canvas.new(256, 256)

(0...255).each do |x|
  (0...255).each do |y|
    # RGBA.from_rgb_n(values, bit_depth) is an internal helper method
    # that creates an RGBA object from a rgb triplet with a given bit depth
    color = RGBA.from_rgb_n(x, y, 255, 8)
    canvas[x, y] = color
  end
end

StumpyPNG.write(canvas, "rainbow.png")

StumpyGIF

Crystal library for creating (animated) gif files.

Source code on Github: stumpycr/stumpy gif

rainbow_neuquant.gif

Figure 1: Rainbow GIF


Last export: 2020-07-12 Sun 22:29
This document is also available as plain text and pdf.

If you have an idea how this page could be improved or a comment send me a mail.