All Projects → porglezomp → pixel-canvas

porglezomp / pixel-canvas

Licence: other
A crate to make drawing in a buffer of pixels easy!

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to pixel-canvas

Score
ossia score, an interactive sequencer for the intermedia arts.
Stars: ✭ 808 (+4152.63%)
Mutual labels:  art, interactive
microbium-app
Draw new worlds
Stars: ✭ 89 (+368.42%)
Mutual labels:  art, interactive
interactive-pixelator
🌇 🌃 upload image and make interactive pixel art 🕹
Stars: ✭ 22 (+15.79%)
Mutual labels:  art, interactive
tripbot9000
Procedural generation of geometric patterns and fractals.
Stars: ✭ 22 (+15.79%)
Mutual labels:  art
php-lands
🗺 The PHP Lands Map
Stars: ✭ 22 (+15.79%)
Mutual labels:  art
devBanner
Create your own devRant banner
Stars: ✭ 45 (+136.84%)
Mutual labels:  art
glitch-image
🖼 Generate and save unique glitchy images
Stars: ✭ 46 (+142.11%)
Mutual labels:  art
neuralPainting
neural painting with pytorch implementation
Stars: ✭ 62 (+226.32%)
Mutual labels:  art
Wallpaper-Maker
WinForms based, Programmatically generated Wallpaper maker which makes Minimalist style wallpapers.
Stars: ✭ 21 (+10.53%)
Mutual labels:  art
frameV
Framed Visuals: collaborative generative art.
Stars: ✭ 20 (+5.26%)
Mutual labels:  art
marcizhu
An interactive chess game in a README file!
Stars: ✭ 37 (+94.74%)
Mutual labels:  interactive
stingray-plugin
Autodesk Interactive Plugin. Fork it, Build it, Ship it!
Stars: ✭ 28 (+47.37%)
Mutual labels:  interactive
facade
Facade Framework - autogenerated embedded live dashboards for Rust apps
Stars: ✭ 95 (+400%)
Mutual labels:  interactive
text
An experiment with WebSockets and the human condition.
Stars: ✭ 51 (+168.42%)
Mutual labels:  art
interactive-window
Visual Studio Interactive Window
Stars: ✭ 53 (+178.95%)
Mutual labels:  interactive
SdfFontDesigner
Offline font tuning/bitmap generation via shaders
Stars: ✭ 56 (+194.74%)
Mutual labels:  art
sisyphus
Lists of random resources
Stars: ✭ 24 (+26.32%)
Mutual labels:  art
Photomosaic-generator
photomosaic generator (image to image, video to video)
Stars: ✭ 131 (+589.47%)
Mutual labels:  art
shapeshop
Towards Understanding Deep Learning Representations via Interactive Experimentation
Stars: ✭ 16 (-15.79%)
Mutual labels:  interactive
fishdraw
procedurally generated fish drawings
Stars: ✭ 1,963 (+10231.58%)
Mutual labels:  art

Crates.io Docs.rs Build Status

Pixel Canvas

This crate is designed to make it easy to build interactive computer art with just a pixel buffer. For inspiration, consider looking at https://shadertoy.com and http://www.iquilezles.org/www/index.htm, there are a lot of cool art pieces to see and explanations of fun techniques!

Usage

To make a piece of art, you create and configure a Canvas object, and then you ask it to render with your code. The canvas will do state management and hand you an image to modify. Whatever modifications you make to the image will be displayed on the screen.

Example

use pixel_canvas::{Canvas, Color, input::MouseState};

fn main() {
    // Configure the window that you want to draw in. You can add an event
    // handler to build interactive art. Input handlers for common use are
    // provided.
    let canvas = Canvas::new(512, 512)
        .title("Tile")
        .state(MouseState::new())
        .input(MouseState::handle_input);
    // The canvas will render for you at up to 60fps.
    canvas.render(|mouse, image| {
        // Modify the `image` based on your state.
        let width = image.width() as usize;
        for (y, row) in image.chunks_mut(width).enumerate() {
            for (x, pixel) in row.iter_mut().enumerate() {
                let dx = x as i32 - mouse.x;
                let dy = y as i32 - mouse.y;
                let dist = dx * dx + dy * dy;
                *pixel = Color {
                    r: if dist < 128 * 128 { dy as u8 } else { 0 },
                    g: if dist < 128 * 128 { dx as u8 } else { 0 },
                    b: (x * y) as u8,
                }
            }
        }
    });
}

License: MIT OR Apache-2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].