Giter VIP home page Giter VIP logo

points's Introduction

Points

Build Status

Mona Lisa

Simple utility for turning a bitmap into colored dots whose diameter is proportional to the luminescence of the region the dot represents and the color is the average color of the area.

The program outputs SVG since this is usually more useful than a bitmap if you plan to use the output as part of a workflow.

This program is probably slow, and fairly suboptimal stemming from the fact that I have absolutely no experience writing graphics utilities. But hopefully it is easy to read and understand.

Building and installing

To install

go get -u github.com/borud/points

Usage

points <flags>
  • -f <filename> : the input filename. Accepts JPEG, PNG and GIF as input.
  • -o <filename> : the output filename. Default is original name with SVG suffix.
  • -b <int> : the box size in pixels.
  • -s <int> : the scale with which svg fill will be scaled compared to original file.
  • -t : luma threshold (0.0 to 1.0)
  • -l : use BT.701 luma function instead of BT.601 to give more weight to red and blue
  • -c : use average color for area rather than just black (default true)
  • -a : use the luma as the surface area instead of the radius (default false)

Example usages

./points -f test.jpg -o mytest.svg -b 50 -t 0.6 

This produces the file test.svg with a box size of 50, a luma threshold of 0.6 and writes it to mytest.svg.

Box size

The box size refers to the size of the box each circle represents. Since the box is square it represents the length of a side measured in pixels. So a value of 30 means that the image is divided into boxes that are 30x30 pixels in size.

Luma Threshold

The Luma Threshold is used to eliminate small dots to make a more pleasing picture. Since the diameter of the dots represents how dark they are, dots representing bright areas will be very small and thus make the picture look noisy.

  • A value of 1.0 includes all the dots.
  • A value of 0.0 removes all the dots.

Some examples

./points -f mona.jpg -b 15

Mona Lisa

./points -f mona.jpg -b 80

Mona Lisa

./points -f mona.jpg -b 10 -m -t 0.3

Mona Lisa

points's People

Contributors

borud avatar harryecran avatar httpain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

points's Issues

Use area rather than diameter to represent luminosity

yodon (possibly @yoDon on Github?) on Hacker News suggested using area rather than diameter to represent luminosity, which sounds like a really good idea. Implement this and see if it gives better results, optionally make it a command line option to let the user choose.

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.