Giter VIP home page Giter VIP logo

data-pixels's Introduction

DATA PIXELS / Create Pixel Art Programmatically

The DataPixels.js source code facilitates production of pixel art that is entirely generated programmatically at runtime. Additionally, the accompanying desktop application, Data Pixels Playground, may be used to write and execute code for displaying both customized and automated pixel art.

DataPixels.js

The DataPixels.js source code features a modular, ES2015 Class design for accessible and effortless construction of new instances. Each instance contains both HTMLCanvasElement and HTMLImageElement public accessors whose sources consist of the programmatically generated pixel art.

The DataPixels.js constructor requires 2 arguments:

  1. pixelData: An array containing one or more arrays of equal length, consisting of strings composed of 0-255 integer values per 24-bit RGB color channel (e.g., “255, 255, 255”) or 32-bit RGBA color channel (e.g., “255, 255, 255, 255”). Additionally, the strings may optionally contain any kind of descriptive text (e.g., “Red: 255, G - 128, 64 for Blue, Transparency = 32”) as only the number values within the string will be parsed in RGB / RGBA order. Strings that contain more than 4 numbers will throw an error.

  2. pixelSize: The size of each color data unit in pixels. This value represents the size of each perceived pixel that forms the pixel art.

Code Output

Data Pixels Playground

Data Pixels Playground is a lightweight, cross-platform, desktop application for Windows, Mac and Linux, which may be used to write and execute DataPixels.js instances for previewing and testing purposes.

The application features built-in example code via the Help menu as well as the ability to parse pixel data from image files to produce automatically generated code through the File > Open Image File… menu item or through drag-and-drop gestures.

Note: pixel color values that are automatically interpreted from image files with an embedded color space may differ slightly from the image’s intended color values.

Application Screenshot

Desktop Application Release Builds

Creating release builds for Windows, Mac and/or Linux is a 2-step process: code compilation, then application packaging, both of which are accomplished by running command-line NPM scripts that execute Gulp tasks.

Compilation

Production code compilation can be executed by entering the following CLI command at the project root folder [~/DataPixels/ ]:

npm run prod

For more detailed information concerning code compilation please refer to Project Foundation.

Packaging

Application packaging can be executed for either all or individual deployment targets by entering one of the following CLI commands at the project build folder [~/DataPixels/resources/build/ ]:

npm run package
npm run package-linux
npm run package-mac
npm run package-windows

Note: In order to avoid problems with code signing and other build issues it is highly recommended to execute packaging scripts for an individual platform from its own operating system.

For more detailed information concerning application packaging please refer to Electron Packager.

License

MIT License

Copyright © 2017 Geoffrey Mattie

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.