Crates.io | pixelate |
lib.rs | pixelate |
version | 0.1.0 |
source | src |
created_at | 2019-04-04 08:46:26.480946 |
updated_at | 2019-04-04 08:46:26.480946 |
description | Fast, pixelated, palette-based PNG renderer |
homepage | |
repository | https://github.com/maciejhirsz/pixelate |
max_upload_size | |
id | 125798 |
size | 48,927 |
It's only 861 bytes for a 720x128 image. Check out the code.
Rendering up-scaled pixelated PNG files can be quite useful for things like:
Usually a PNG image data, before compression, is a bitmap that packs 3 or 4 bytes per pixel, depending whether transparency is present or not. For all of the cases above this is way more information than necessary.
PNG supports an indexed palette format. Using the indexing palette makes it possible not only to pack a single pixel into a single byte, but for small palettes a pixel can be 4, 2, or even just 1 bit. The logo here is using 3 colors (black, transparent background and shadow), which allows Pixelate to produce a bitmap where each pixel takes only 2 bits.
Not only does this produce smaller images after compression, smaller bitmap is also much faster to compress, as much as 10x for small palettes. This makes it ideal for rendering QR codes or identicons on the fly.
Ramhorns is free software, and is released under the terms of the GNU General Public License version 3. See LICENSE.