Git Product home page Git Product logo

threadtone's Introduction

ThreadTone | a halftone representation of an image made of thread

The process of generating an image with thread is an idea of Petros Vrellis. As I've documented here the process is comprised of three steps:

  • Image pre-processing (cropping, resizing, etc.)
  • Algorithm to place threads
  • In my case parsing the result to G-Code for automated fabrication

To use this tool, run:

python threadTone.py -p [image-path] -l [number-of-lines-to-draw] -n [number-of-pins-to-draw-with]

ex: python threadTone.py -p kitten.jpg -l 2000 -n 250
ex: python threadTone.py -p puppr.png

Note: imgPath is a required field, and to give a value to numPins

A set of two example images can be found below. Please refer to my blog for more details.

Threaded portrait of Poetin

Threaded portrait of Angelina

License

This script is released under MIT License.

threadtone's People

Contributors

jayache80 avatar nullshii avatar theveloped avatar turnipjs 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

threadtone's Issues

Image window appears than it crashes

I had some issues about running the code. Before I downloaded from here I coppied all lines from your project webpage: http://www.thevelop.nl/blog/2016-12-25/ThreadTone/ With somo minor modifications I succeded to run the code. However there is no display modules like you shared in project webpage. Thus I decided to download the updated version from github. When I run the code there is an image windows appears than it freezes. I tried to reduced numPines and numLines but result is still the same. Could you please help me to figure out what is the problem.

Requirements ?

1 thing missing from the README is the requirements to use the program.

  • Imports. You could provide a requirements.txt for that, which'll make pip's life simple. The program could try using pip to install the requirements to the current venv automatically on start, or at least ask first.
  • Python version. The print(...) function can malfunction in Py2 since the grammar thinks those parenthesis are tuple indicators instead of a function. That can be fixed with from __future__ import print_function.

Update numpy int convert

Updated from

return (x.astype(np.int)-1, y.astype(np.int)-1)

to

return (x.astype(int)-1, y.astype(int)-1)

in line 113

The lines drawn, may not be correct

I just noticed a minor bug which draws the wrong line as the program runs.

line 200:
xLine, yLine = linePixels(coords[bestPin], coord)

I think should look like that:
xLine, yLine = linePixels(oldCoord, coords[bestPin])

Great project though, and a good excuse to finally dive a little more into numpy. Thank you for sharing.

Broken on Python 3

There's at least 1 spot where I know for sure this script'll break if run under Python 3: print "TEXT"

Square shape

How can I rework the script to get a square image?

Help!

I can't find a way to convert to Gcode(.NC), hope the author can guide

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.