scramblery


Namescramblery JSON
Version 1.2.5 PyPI version JSON
download
home_pagehttps://github.com/altunenes/scramblery
Summary
upload_time2023-10-21 00:44:05
maintainer
docs_urlNone
authoraltunenes
requires_python>=3.8,<4.0
licenseMIT
keywords scramblery scramble face scramble psychology experimental psychology altunenes
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
             # Scramblery
[![Downloads](https://pepy.tech/badge/scramblery)](https://pepy.tech/project/scramblery)
[![PyPI version](https://badge.fury.io/py/scramblery.svg)](https://badge.fury.io/py/scramblery)
[![Jekyll site CI](https://github.com/altunenes/scramblery/actions/workflows/jekyll.yml/badge.svg)](https://github.com/altunenes/scramblery/actions/workflows/jekyll.yml)
[![Build status](https://ci.appveyor.com/api/projects/status/amuravq7o2afvv65?svg=true)](https://ci.appveyor.com/project/altunenes/scramblery)
[![DOI](https://zenodo.org/badge/449034134.svg)](https://zenodo.org/badge/latestdoi/449034134)

![sacasc](https://user-images.githubusercontent.com/54986652/227797464-3fc1fc88-a31b-4244-b99f-df0f77a6e282.png)


A simple tool to scramble your images or only faces from images or videos. You can find the online demo in javascript [here](https://altunenes.github.io/scramblery/scramblerydemo.html). For more information, please visit the [documentation](https://altunenes.github.io/scramblery/).

Note: The Javascript demo doesn't have a face detection algorithm and it's designed to be applied to a single image. If you want to do this for multiple imagees you should use Python.


### Purpose of Package
The Scramblery package offers tools for creating scrambled images from existing images or videos. Users have the flexibility to scramble entire images or target only specific areas, such as faces. This functionality is particularly beneficial in psychological experiments involving facial recognition tasks. With Scramblery, users can automate the scrambling of multiple images, eliminating the tedious manual process traditionally associated with this task. We hope this package significantly contributes to your research endeavors.

### Motivation

- Image scrambling plays a crucial role in psychology experiments, enabling researchers to manipulate visual stimuli while maintaining control over certain visual aspects. This manipulation helps eliminate or alter specific features or patterns that may influence participants' perceptions or responses.

- Scramblery allows for the creation of stimuli that retain general attributes such as luminance, contrast, and spatial layout, but lack identifiable features or objects. This is useful in experiments where researchers wish to control for these specific attributes.

- The package helps in mitigating biases and confounding variables in stimuli, thereby providing more reliable and valid experimental conditions. The ability to automate this process ensures consistency across stimuli and saves valuable time for researchers.

### Features

- Scramble an entire image with a specified degree of scrambling (either by altering pixel values or pixel coordinates).
- Target scrambling to only the facial area within an image, with customizable levels of scrambling.
- Extend the scrambling feature to videos, particularly useful for dynamic stimuli in motion-based experiments.
- Leverage Fourier-based scrambling to disrupt the phase information while maintaining the power spectrum, particularly useful for psychophysical studies.

### Installation

Scramblery is available on PyPI and can be installed using pip. Use the following command in your terminal:

#### Installation
- The package can be found in pypi. To install the package, run the following command in the terminal:
- `pip install scramblery`



- `from scramblery import scramblery`
Then use the functions as follows to scramble images. I added some examples below.

  ![8x8](./docs/assets/usage.PNG)

  ![12x12](./docs/assets/types.png)
  ![8x8](./docs/assets/fr.png)




### Usage

After installation, you can import and use Scramblery as follows:

```python
from scramblery import scramblery

# To scramble an entire image
scramblery.scrambleimage("Lena.png", x_block=10, y_block=10, scramble_type='classic', seed=None, write=True)

# To scramble only the facial area within an image
scramblery.scrambleface("Lena.png", splits=10, type='pixel', seamless=False, bg=True, seed=None, write=True)

# To apply Fourier-based scrambling on an image
scramblery.scrambleimage("Lena.png", scramble_type='fourier', scramble_ratio=0.5, seed=None, write=True)
# To apply Fourier-based scrambling o only the facial area within an image
scramblery.scrambleface("lena.png",splits=10,type='fourier', scramble_ratio=0.5,write=True)

# To scramble faces within a video first we need to create a dict.
scramble_settings = {
    'splits': 25,
    'type': 'pixel',
    'bg': True,
    'seed': None,
    'write': False  # Should always be False for video processing
}
scramblery.scramblevideo("input_video.mp4", "output_video.mp4", scramble_settings)
```

### Contribution
We welcome contributions of any kind to Scramblery. If you have ideas for improvement or have found a bug, please don't hesitate to contribute.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/altunenes/scramblery",
    "name": "scramblery",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "scramblery,scramble,face scramble,psychology,experimental psychology,altunenes",
    "author": "altunenes",
    "author_email": "enesaltun2@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/16/ec/d7f27ff8d82347b8c4f17a1b9bbc7a4126e592b6bd80c7132790f761377e/scramblery-1.2.5.tar.gz",
    "platform": null,
    "description": " # Scramblery\n[![Downloads](https://pepy.tech/badge/scramblery)](https://pepy.tech/project/scramblery)\n[![PyPI version](https://badge.fury.io/py/scramblery.svg)](https://badge.fury.io/py/scramblery)\n[![Jekyll site CI](https://github.com/altunenes/scramblery/actions/workflows/jekyll.yml/badge.svg)](https://github.com/altunenes/scramblery/actions/workflows/jekyll.yml)\n[![Build status](https://ci.appveyor.com/api/projects/status/amuravq7o2afvv65?svg=true)](https://ci.appveyor.com/project/altunenes/scramblery)\n[![DOI](https://zenodo.org/badge/449034134.svg)](https://zenodo.org/badge/latestdoi/449034134)\n\n![sacasc](https://user-images.githubusercontent.com/54986652/227797464-3fc1fc88-a31b-4244-b99f-df0f77a6e282.png)\n\n\nA simple tool to scramble your images or only faces from images or videos. You can find the online demo in javascript [here](https://altunenes.github.io/scramblery/scramblerydemo.html). For more information, please visit the [documentation](https://altunenes.github.io/scramblery/).\n\nNote: The Javascript demo doesn't have a face detection algorithm and it's designed to be applied to a single image. If you want to do this for multiple imagees you should use Python.\n\n\n### Purpose of Package\nThe Scramblery package offers tools for creating scrambled images from existing images or videos. Users have the flexibility to scramble entire images or target only specific areas, such as faces. This functionality is particularly beneficial in psychological experiments involving facial recognition tasks. With Scramblery, users can automate the scrambling of multiple images, eliminating the tedious manual process traditionally associated with this task. We hope this package significantly contributes to your research endeavors.\n\n### Motivation\n\n- Image scrambling plays a crucial role in psychology experiments, enabling researchers to manipulate visual stimuli while maintaining control over certain visual aspects. This manipulation helps eliminate or alter specific features or patterns that may influence participants' perceptions or responses.\n\n- Scramblery allows for the creation of stimuli that retain general attributes such as luminance, contrast, and spatial layout, but lack identifiable features or objects. This is useful in experiments where researchers wish to control for these specific attributes.\n\n- The package helps in mitigating biases and confounding variables in stimuli, thereby providing more reliable and valid experimental conditions. The ability to automate this process ensures consistency across stimuli and saves valuable time for researchers.\n\n### Features\n\n- Scramble an entire image with a specified degree of scrambling (either by altering pixel values or pixel coordinates).\n- Target scrambling to only the facial area within an image, with customizable levels of scrambling.\n- Extend the scrambling feature to videos, particularly useful for dynamic stimuli in motion-based experiments.\n- Leverage Fourier-based scrambling to disrupt the phase information while maintaining the power spectrum, particularly useful for psychophysical studies.\n\n### Installation\n\nScramblery is available on PyPI and can be installed using pip. Use the following command in your terminal:\n\n#### Installation\n- The package can be found in pypi. To install the package, run the following command in the terminal:\n- `pip install scramblery`\n\n\n\n- `from scramblery import scramblery`\nThen use the functions as follows to scramble images. I added some examples below.\n\n  ![8x8](./docs/assets/usage.PNG)\n\n  ![12x12](./docs/assets/types.png)\n  ![8x8](./docs/assets/fr.png)\n\n\n\n\n### Usage\n\nAfter installation, you can import and use Scramblery as follows:\n\n```python\nfrom scramblery import scramblery\n\n# To scramble an entire image\nscramblery.scrambleimage(\"Lena.png\", x_block=10, y_block=10, scramble_type='classic', seed=None, write=True)\n\n# To scramble only the facial area within an image\nscramblery.scrambleface(\"Lena.png\", splits=10, type='pixel', seamless=False, bg=True, seed=None, write=True)\n\n# To apply Fourier-based scrambling on an image\nscramblery.scrambleimage(\"Lena.png\", scramble_type='fourier', scramble_ratio=0.5, seed=None, write=True)\n# To apply Fourier-based scrambling o only the facial area within an image\nscramblery.scrambleface(\"lena.png\",splits=10,type='fourier', scramble_ratio=0.5,write=True)\n\n# To scramble faces within a video first we need to create a dict.\nscramble_settings = {\n    'splits': 25,\n    'type': 'pixel',\n    'bg': True,\n    'seed': None,\n    'write': False  # Should always be False for video processing\n}\nscramblery.scramblevideo(\"input_video.mp4\", \"output_video.mp4\", scramble_settings)\n```\n\n### Contribution\nWe welcome contributions of any kind to Scramblery. If you have ideas for improvement or have found a bug, please don't hesitate to contribute.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "",
    "version": "1.2.5",
    "project_urls": {
        "Homepage": "https://github.com/altunenes/scramblery",
        "Repository": "https://github.com/altunenes/scramblery"
    },
    "split_keywords": [
        "scramblery",
        "scramble",
        "face scramble",
        "psychology",
        "experimental psychology",
        "altunenes"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d24f66b97648cc43ca47d18cb4bb9f190f88e4e418f8bdacb4630334ac678fda",
                "md5": "b9a594c1c1624cbbd9278f402d583728",
                "sha256": "28dc4f671104cd498660ddf40fc0f08a1633b3c493615cc9e2ba476a942eca59"
            },
            "downloads": -1,
            "filename": "scramblery-1.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b9a594c1c1624cbbd9278f402d583728",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 8232,
            "upload_time": "2023-10-21T00:44:03",
            "upload_time_iso_8601": "2023-10-21T00:44:03.807617Z",
            "url": "https://files.pythonhosted.org/packages/d2/4f/66b97648cc43ca47d18cb4bb9f190f88e4e418f8bdacb4630334ac678fda/scramblery-1.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "16ecd7f27ff8d82347b8c4f17a1b9bbc7a4126e592b6bd80c7132790f761377e",
                "md5": "eba21248358ef33bc4151af0a814f2c5",
                "sha256": "6632a09635b8dbaecbddc5e4a3339c66112ec3935907e7f941f2125673fef07a"
            },
            "downloads": -1,
            "filename": "scramblery-1.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "eba21248358ef33bc4151af0a814f2c5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 8610,
            "upload_time": "2023-10-21T00:44:05",
            "upload_time_iso_8601": "2023-10-21T00:44:05.751027Z",
            "url": "https://files.pythonhosted.org/packages/16/ec/d7f27ff8d82347b8c4f17a1b9bbc7a4126e592b6bd80c7132790f761377e/scramblery-1.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-21 00:44:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "altunenes",
    "github_project": "scramblery",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "scramblery"
}
        
Elapsed time: 0.13102s