Code Monkey home page Code Monkey logo

pictone's Introduction

PicTone

Language GitHub license

PicTone is a simple, fun Python CLI tool that converts images into vectorscope audios. It supports tweaking multiple parameters and sampling sequences of images.

Installation

To install PicTone, use pip:

pip install pictone

You'll need Python 3.6 or higher.

Usage

PicTone is a command-line tool that converts the images into WAV files using a sampler with edge detection. You can tweak its parameters and the way the images are passed to it.

Command Line

The basic command structure for using PicTone is as follows:

pictone -i input_path -o output_path [options]

Input can be either an image or a folder with an ordered sequence of them.

In addition to the required input and output paths, there are some optional arguments to shape the result:

  • -r --rate: Sample rate for the output audio. Default is 44100 Hz.
  • -d --depth: Bit depth for audio samples. Can be 8, 16, or 24. Default is 16.
  • -s --samples: Number of samples the inputs should be forced to last. By default, they'll last the minimum. This is useful if you are converting a sequence (e.g. Forcing to 735 with a rate of 44100 would achieve a ~60 fps visualization).
  • -a --aspect: Boolean value to decide whether to preserve the input aspect ratio. Defaults to True.

As a Library

If you want to experiment, the sampler can be instantiated and configured by yourself. Although it just outputs a single input raw data:

import cv2
from pictone.sampler import EdgeSampler

image = cv2.imread("image.png", 0)
image_edges = cv2.Canny(image, 100, 200)

edge_threshold = 0
byte_depth = 2

sampler = EdgeSampler(edge_threshold, byte_depth) # Basic params

sampled_data = sampler.sample_frames(image_edges)

pictone's People

Contributors

eterdelta avatar

Stargazers

BlackNoizE404 avatar  avatar Pedro  avatar  avatar Argo avatar

Watchers

 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.