Code Monkey home page Code Monkey logo

pxl's Introduction

Pxl

A small utility written in Go to generate pixelart from PNG images.

Installation

Use the Makefile in this repository (make release) or compile pixelize.go (go build ./pixelize.go)

Usage

Pxl takes a PNG image as input and converts it to a pixelized version using different options.

Usage: pxl [command] [options...] <file.png>
	Command: convert
	Description: Converts a png image file to pixel art
		-o Path to the output file. Default is result.png
		-c Path to the colors json file.
		-l Level of granularity. Default is 8 Bit
		-w Maximum width for image resizing.
		-h Maximum height for image resizing.
	Command: colors
	Description: Extracts a color palette from a png image file
		-o Path to the output file. Default is colors.json
		-c Number of colors to extract into palette.

or use pxl as go module

import "github.com/cbrgm/pxl/pxl"
// ...
px := pxl.New()

px.SetGranularity(8)
px.SetMaxImageSize(1024, 800)
px.SetColors(palette.Websafe)

usePalette := true
pixelArt := px.Convert(img, usePalette)
// ...

pxl's People

Contributors

cbrgm avatar dependabot[bot] avatar

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.