Examples

A photo converted by png2pix.py, in the default colormap’s colours.

examples/art/pix_ckbGH.scad is png2pix.py’s output for art/ckbGitHubProfile.png at –downscale 4.

Source: examples/sample_pixel_art_ckbGH.scad
// A photo converted by png2pix.py, in the default colormap's colours.
// examples/art/pix_ckbGH.scad is png2pix.py's output for art/ckbGitHubProfile.png at --downscale 4.
use <../pixel_art.scad>
include <art/pix_ckbGH.scad>

PixArt(H=pix_ckbGH);

examples/sample_pixel_art_ckbGH.scad on GitHub

The original is black on a transparent background; a search-and-replace on the generated array in examples/art/pix_FastLogo.scad made it purple on white.

Source: examples/sample_pixel_art_fastlogo.scad
// A logo converted by png2pix.py, then recoloured by editing the array.
// The original is black on a transparent background; a search-and-replace on the generated
// array in examples/art/pix_FastLogo.scad made it purple on white.
use <../pixel_art.scad>
include <art/pix_FastLogo.scad>

PixArt(H=pix_FastLogo);

examples/sample_pixel_art_fastlogo.scad on GitHub

The arrays are in examples/art/pix_Gallery.scad and pix00.scad.

Source: examples/sample_pixel_art_gallery.scad
// Hand-written patterns: each is a list of strings, one character per pixel.
// The arrays are in examples/art/pix_Gallery.scad and pix00.scad.
use <../pixel_art.scad>
include <../pix00.scad>
include <art/pix_Gallery.scad>

// Which pattern to draw
example = "all"; // [all, 00, alien, hello, ghost, heart]

if (example == "all") {
    PixArt(H=PixHello);
    translate([0, 120, 0]) PixArt(H=Pix00);
    translate([190, 120, 0]) PixArt(H=PixAlien);
    translate([330, 120, 0]) PixArt(H=PixGhost);
    translate([460, 120, 0]) PixArt(H=PixHeart);
} else if (example == "00") {
    PixArt(H=Pix00);
} else if (example == "alien") {
    PixArt(H=PixAlien);
} else if (example == "hello") {
    PixArt(H=PixHello);
} else if (example == "ghost") {
    PixArt(H=PixGhost);
} else if (example == "heart") {
    PixArt(H=PixHeart);
} else {
    assert(false, str("unknown example ", example));
}

examples/sample_pixel_art_gallery.scad on GitHub


This site uses Just the Docs, a documentation theme for Jekyll.