PySSTV


NamePySSTV JSON
Version 0.5.6 PyPI version JSON
download
home_pagehttps://github.com/dnet/pySSTV
SummaryPython classes for generating Slow-scan Television transmissions
upload_time2023-11-06 07:54:41
maintainer
docs_urlNone
authorAndrás Veres-Szentkirályi
requires_python
licenseMIT
keywords ham sstv slow-scan television scottie martin robot pasokon
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            SSTV generator in pure Python
=============================

PySSTV generates SSTV modulated WAV files from any image that PIL can open
(PNG, JPEG, GIF, and many others). These WAV files then can be played by any
audio player connected to a shortwave radio for example.

My main motivation was to understand the internals of SSTV in practice, so
performance is far from optimal. I tried keeping the code readable, and only
performed such optimizations that wouldn't have complicated the codebase.

Command line usage
------------------

    $ python -m pysstv -h
    usage: __main__.py [-h]
                  [--mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,Robot8BW,Robot24BW}]
                  [--rate RATE] [--bits BITS] [--vox] [--fskid FSKID]
                  [--chan CHAN]
                  image.png output.wav

    Converts an image to an SSTV modulated WAV file.

    positional arguments:
      image.png             input image file name
      output.wav            output WAV file name

    optional arguments:
      -h, --help            show this help message and exit
      --mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120D160,PD180,PD240,Robot8BW,Robot24BW}
                            image mode (default: Martin M1)
      --rate RATE           sampling rate (default: 48000)
      --bits BITS           bits per sample (default: 16)
      --vox                 add VOX tones at the beginning
      --fskid FSKID         add FSKID at the end
      --chan CHAN           number of channels (default: mono)
      --resize              resize the image to the correct size
      --keep-aspect-ratio   keep the original aspect ratio when resizing 
                                (and cut off excess pixels)
      --keep-aspect         keep the original aspect ratio when resizing 
                                (not cut off excess pixels)
      --resample            which resampling filter to use for resizing
                                (see Pillow documentation)

Python interface
----------------

The `SSTV` class in the `sstv` module implements basic SSTV-related
functionality, and the classes of other modules such as `grayscale` and
`color` extend this. Most instances implement the following methods:

 - `__init__` takes a PIL image, the samples per second, and the bits per
   sample as a parameter, but doesn't perform any hard calculations
 - `gen_freq_bits` generates tuples that describe a sine wave segment with
   frequency in Hz and duration in ms
 - `gen_values` generates samples between -1 and +1, performing sampling
   according to the samples per second value given during construction
 - `gen_samples` generates discrete samples, performing quantization
   according to the bits per sample value given during construction
 - `write_wav` writes the whole image to a Microsoft WAV file

The above methods all build upon those above them, for example `write_wav`
calls `gen_samples`, while latter calls `gen_values`, so typically, only
the first and the last, maybe the last two should be called directly, the
others are just listed here for the sake of completeness and to make the
flow easier to understand.

License
-------

The whole project is available under MIT license.

Useful links
------------

 - receive-only "counterpart": https://github.com/windytan/slowrx
 - free SSTV handbook: http://www.sstv-handbook.com/
 - robot 36 encoder/decoder in C: https://github.com/xdsopl/robot36/

Dependencies
------------

 - Python 3.5 or later
 - Python Imaging Library (Debian/Ubuntu package: `python3-pil`)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dnet/pySSTV",
    "name": "PySSTV",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "HAM SSTV slow-scan television Scottie Martin Robot Pasokon",
    "author": "Andr\u00e1s Veres-Szentkir\u00e1lyi",
    "author_email": "vsza@vsza.hu",
    "download_url": "https://files.pythonhosted.org/packages/a7/f9/15a1489fef7397e1e374cb94cc709aef9bbaf6e1b8fad8464c3350608893/PySSTV-0.5.6.tar.gz",
    "platform": null,
    "description": "SSTV generator in pure Python\n=============================\n\nPySSTV generates SSTV modulated WAV files from any image that PIL can open\n(PNG, JPEG, GIF, and many others). These WAV files then can be played by any\naudio player connected to a shortwave radio for example.\n\nMy main motivation was to understand the internals of SSTV in practice, so\nperformance is far from optimal. I tried keeping the code readable, and only\nperformed such optimizations that wouldn't have complicated the codebase.\n\nCommand line usage\n------------------\n\n    $ python -m pysstv -h\n    usage: __main__.py [-h]\n                  [--mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,Robot8BW,Robot24BW}]\n                  [--rate RATE] [--bits BITS] [--vox] [--fskid FSKID]\n                  [--chan CHAN]\n                  image.png output.wav\n\n    Converts an image to an SSTV modulated WAV file.\n\n    positional arguments:\n      image.png             input image file name\n      output.wav            output WAV file name\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      --mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120D160,PD180,PD240,Robot8BW,Robot24BW}\n                            image mode (default: Martin M1)\n      --rate RATE           sampling rate (default: 48000)\n      --bits BITS           bits per sample (default: 16)\n      --vox                 add VOX tones at the beginning\n      --fskid FSKID         add FSKID at the end\n      --chan CHAN           number of channels (default: mono)\n      --resize              resize the image to the correct size\n      --keep-aspect-ratio   keep the original aspect ratio when resizing \n                                (and cut off excess pixels)\n      --keep-aspect         keep the original aspect ratio when resizing \n                                (not cut off excess pixels)\n      --resample            which resampling filter to use for resizing\n                                (see Pillow documentation)\n\nPython interface\n----------------\n\nThe `SSTV` class in the `sstv` module implements basic SSTV-related\nfunctionality, and the classes of other modules such as `grayscale` and\n`color` extend this. Most instances implement the following methods:\n\n - `__init__` takes a PIL image, the samples per second, and the bits per\n   sample as a parameter, but doesn't perform any hard calculations\n - `gen_freq_bits` generates tuples that describe a sine wave segment with\n   frequency in Hz and duration in ms\n - `gen_values` generates samples between -1 and +1, performing sampling\n   according to the samples per second value given during construction\n - `gen_samples` generates discrete samples, performing quantization\n   according to the bits per sample value given during construction\n - `write_wav` writes the whole image to a Microsoft WAV file\n\nThe above methods all build upon those above them, for example `write_wav`\ncalls `gen_samples`, while latter calls `gen_values`, so typically, only\nthe first and the last, maybe the last two should be called directly, the\nothers are just listed here for the sake of completeness and to make the\nflow easier to understand.\n\nLicense\n-------\n\nThe whole project is available under MIT license.\n\nUseful links\n------------\n\n - receive-only \"counterpart\": https://github.com/windytan/slowrx\n - free SSTV handbook: http://www.sstv-handbook.com/\n - robot 36 encoder/decoder in C: https://github.com/xdsopl/robot36/\n\nDependencies\n------------\n\n - Python 3.5 or later\n - Python Imaging Library (Debian/Ubuntu package: `python3-pil`)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python classes for generating Slow-scan Television transmissions",
    "version": "0.5.6",
    "project_urls": {
        "Homepage": "https://github.com/dnet/pySSTV"
    },
    "split_keywords": [
        "ham",
        "sstv",
        "slow-scan",
        "television",
        "scottie",
        "martin",
        "robot",
        "pasokon"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "087382677ff63af80cdd213380c4542bad19881e2b1af64297355f14c9b01740",
                "md5": "fc1b432d383b15f6b86452a8f60a123a",
                "sha256": "533ad7faa1f1dd8a2a4c33298b396b711fb7da4f3f2fbb40db231bcbb40bc2b5"
            },
            "downloads": -1,
            "filename": "PySSTV-0.5.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fc1b432d383b15f6b86452a8f60a123a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 20580,
            "upload_time": "2023-11-06T07:54:40",
            "upload_time_iso_8601": "2023-11-06T07:54:40.005821Z",
            "url": "https://files.pythonhosted.org/packages/08/73/82677ff63af80cdd213380c4542bad19881e2b1af64297355f14c9b01740/PySSTV-0.5.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7f915a1489fef7397e1e374cb94cc709aef9bbaf6e1b8fad8464c3350608893",
                "md5": "6f76073adbfc77e06b76fbee137325a9",
                "sha256": "d100a90de7d1a3df2ac5cb252112a60a9cfaacce1f9a94e035676593acd27ece"
            },
            "downloads": -1,
            "filename": "PySSTV-0.5.6.tar.gz",
            "has_sig": false,
            "md5_digest": "6f76073adbfc77e06b76fbee137325a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 15993,
            "upload_time": "2023-11-06T07:54:41",
            "upload_time_iso_8601": "2023-11-06T07:54:41.958116Z",
            "url": "https://files.pythonhosted.org/packages/a7/f9/15a1489fef7397e1e374cb94cc709aef9bbaf6e1b8fad8464c3350608893/PySSTV-0.5.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-06 07:54:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dnet",
    "github_project": "pySSTV",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pysstv"
}
        
Elapsed time: 0.13262s