Giter Site home page Giter Site logo

python-halftone's Introduction

python-halftone

A python module that uses PIL to give images a halftone effect.

It is adapted from this StackOverflow answer (which includes example images) by fraxel.

## Usage

import halftone
h = halftone.Halftone('/path/to/myimage.jpg')
h.make(filename_addition='_halftoned')

Will create a new image at /path/to/myimage_halftoned.jpg, halftoned with the default settings.

The full list of options:

  • filename_addition: What to add to the filename (before the extension) (default ``).
  • sample: Sample box size from original image, in pixels (default 10).
  • scale: Max output dot diameter is sample * scale (which is also the number of possible dot sizes) (default 1).
  • percentage: How much of the gray component to remove from the CMY channels and put in the K channel (default 0).
  • angles: A list of 4 angles that each screen channel should be rotated by (default [0,15,30,45,]).

An example of make() using all options:

h.make(
	filename_addition='_dotty',
	sample=5,
	scale=1,
	percentage=50,
	angles[108, 162, 90, 45,]
)

Running it over large images, or with settings that create large images, can take some time.

python-halftone's People

Contributors

philgyford avatar thisisaaronland avatar

Stargazers

 avatar

Watchers

 avatar  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.