pycrusher


Namepycrusher JSON
Version 0.3.11 PyPI version JSON
download
home_pageNone
SummaryGenerate lossy JPEG compressions for fun!
upload_time2024-10-18 13:51:54
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseApache 2.0
keywords image processing jpeg lossy compression
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyCrusher

[![pyCrusher version](https://img.shields.io/pypi/v/pycrusher.svg)](https://pypi.org/project/pycrusher)
[![PyPI downloads](https://static.pepy.tech/badge/pycrusher)](https://pepy.tech/project/pycrusher)
![Accepted Python versions](https://img.shields.io/pypi/pyversions/pycrusher.svg)

**Crusher (Wikipedia):**
>Crushers may be used to reduce the size, or change the form, of waste materials so they can be more easily disposed of or recycled..."

Much like an actual crusher, *pyCrusher* copies your precious little images and turns them into absolute trash (for fun!)

## Install instructions

### [Pipx](https://pipx.pypa.io/stable/)

```bash
pipx install pycrusher
```

### Uv

```bash
uv tool install pycrusher
```

### Pip

```bash
pip install pycrusher
```

### Download manually (Linux/MacOS)

```bash
git clone https://github.com/jonesmartins/pycrusher
cd pycrusher
python setup.py install
```

## Usage

Type in the command line:

```bash
pycrusher <image_file> <flags and parameters>
```

As default, the program saves your output in a special directory called 'compressions' located at `path/to/somewhere`, so if you use *pyCrusher* multiple times in `path/to/somewhere`, you can check your compressed images without mixing it up between your other files.
Every time you save a new file in 'compressions', your output file will be saved with your input name followed by the compression settings. You can still use the -o/--output flag and name it however you want.

Default name: `compression/<image-name>_i<iterations>e<extra><r><p><c>[colors].<extension>`

### Options

```txt
usage: pycrusher [-h] [-i ITERATIONS] [-e EXTRA] [-c [COLORS ...]] [-o OUTPUT] [-r] [-p] file

positional arguments:
  file                  Name of image to compress

options:
  -h, --help            show this help message and exit
  -i ITERATIONS, --iterations ITERATIONS
                        Number of compression iterations
  -e EXTRA, --extra EXTRA
                        Number of nested iterations
  -c [COLORS ...], --colors [COLORS ...]
                        Color changes
  -o OUTPUT, --output OUTPUT
                        Name of output file.
  -r, --reverse         Reverses compression iterations.
  -p, --preprocess      Adds color enhancement BEFORE compression.
```

## Examples

**Original image:** crusher.png

![crusher](https://cloud.githubusercontent.com/assets/15959626/22045694/f78ef41c-dd02-11e6-9594-cd6b00e02884.png)

---

```bash
pycrusher crusher.png
```

**Default output filename:**   compressions/crusher_i50e1.png

![compressed_crusher0](https://cloud.githubusercontent.com/assets/15959626/22045698/fa458d24-dd02-11e6-8265-fdf3b902cded.jpg)

---

```bash
pycrusher crusher.png -i 10
```

**Default output filename:**  compressions/crusher_i10e1.png

![compressed_crusher6](https://cloud.githubusercontent.com/assets/15959626/22045854/0fc4f148-dd04-11e6-9e4d-fd60504fc2d5.jpg)

---

```bash
pycrusher crusher.png -i 10 -e 5
```

**Default output filename:**   compressions/crusher_i10e5.png

![compressed_crusher1](https://cloud.githubusercontent.com/assets/15959626/22045717/1883c198-dd03-11e6-9e76-4a6cb20c0413.jpg)

---

```bash
pycrusher crusher.png -i 20 -c 4
```

**Default output filename:**  compressions/crusher_i20e1c[4.0].png

![compressed_crusher7](https://cloud.githubusercontent.com/assets/15959626/22045906/63ef3a76-dd04-11e6-9ed0-4080a7c92ab9.jpg)

---

```bash
pycrusher crusher.png -i 20 -c 4 -r
```

**Default output filename:** compressions/crusher_i20e1rc[4.0].png

![compressed_crusher5](https://cloud.githubusercontent.com/assets/15959626/22492147/6bc72270-e80f-11e6-8e64-fa678fa03b0a.png)

---

```bash
pycrusher crusher.png -i 20 -c 4 0
```

**Default output filename:**  compressions/crusher_i20e1c[4.0,0.0].png

![compressed_crusher5](https://cloud.githubusercontent.com/assets/15959626/22045830/d62aae5a-dd03-11e6-8efd-a3fb90b42f0b.jpg)

---

```bash
pycrusher crusher.png -i 20 -c 4 0 -p
```

**Default output filename:**  compressions/crusher_i20e1pc[4.0,0.0].png

![compressed_crusher1](https://cloud.githubusercontent.com/assets/15959626/22492096/1640df30-e80f-11e6-94b5-3adedc6771b4.png)

## License

Apache License 2.0

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pycrusher",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "image processing, jpeg, lossy compression",
    "author": null,
    "author_email": "Jones Martins <15959626+jonesmartins@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/55/1e/b3f87da594bd04e44ab986a70a8d32045796ed513f5cfbd1b676b50f1780/pycrusher-0.3.11.tar.gz",
    "platform": null,
    "description": "# pyCrusher\n\n[![pyCrusher version](https://img.shields.io/pypi/v/pycrusher.svg)](https://pypi.org/project/pycrusher)\n[![PyPI downloads](https://static.pepy.tech/badge/pycrusher)](https://pepy.tech/project/pycrusher)\n![Accepted Python versions](https://img.shields.io/pypi/pyversions/pycrusher.svg)\n\n**Crusher (Wikipedia):**\n>Crushers may be used to reduce the size, or change the form, of waste materials so they can be more easily disposed of or recycled...\"\n\nMuch like an actual crusher, *pyCrusher* copies your precious little images and turns them into absolute trash (for fun!)\n\n## Install instructions\n\n### [Pipx](https://pipx.pypa.io/stable/)\n\n```bash\npipx install pycrusher\n```\n\n### Uv\n\n```bash\nuv tool install pycrusher\n```\n\n### Pip\n\n```bash\npip install pycrusher\n```\n\n### Download manually (Linux/MacOS)\n\n```bash\ngit clone https://github.com/jonesmartins/pycrusher\ncd pycrusher\npython setup.py install\n```\n\n## Usage\n\nType in the command line:\n\n```bash\npycrusher <image_file> <flags and parameters>\n```\n\nAs default, the program saves your output in a special directory called 'compressions' located at `path/to/somewhere`, so if you use *pyCrusher* multiple times in `path/to/somewhere`, you can check your compressed images without mixing it up between your other files.\nEvery time you save a new file in 'compressions', your output file will be saved with your input name followed by the compression settings. You can still use the -o/--output flag and name it however you want.\n\nDefault name: `compression/<image-name>_i<iterations>e<extra><r><p><c>[colors].<extension>`\n\n### Options\n\n```txt\nusage: pycrusher [-h] [-i ITERATIONS] [-e EXTRA] [-c [COLORS ...]] [-o OUTPUT] [-r] [-p] file\n\npositional arguments:\n  file                  Name of image to compress\n\noptions:\n  -h, --help            show this help message and exit\n  -i ITERATIONS, --iterations ITERATIONS\n                        Number of compression iterations\n  -e EXTRA, --extra EXTRA\n                        Number of nested iterations\n  -c [COLORS ...], --colors [COLORS ...]\n                        Color changes\n  -o OUTPUT, --output OUTPUT\n                        Name of output file.\n  -r, --reverse         Reverses compression iterations.\n  -p, --preprocess      Adds color enhancement BEFORE compression.\n```\n\n## Examples\n\n**Original image:** crusher.png\n\n![crusher](https://cloud.githubusercontent.com/assets/15959626/22045694/f78ef41c-dd02-11e6-9594-cd6b00e02884.png)\n\n---\n\n```bash\npycrusher crusher.png\n```\n\n**Default output filename:**   compressions/crusher_i50e1.png\n\n![compressed_crusher0](https://cloud.githubusercontent.com/assets/15959626/22045698/fa458d24-dd02-11e6-8265-fdf3b902cded.jpg)\n\n---\n\n```bash\npycrusher crusher.png -i 10\n```\n\n**Default output filename:**  compressions/crusher_i10e1.png\n\n![compressed_crusher6](https://cloud.githubusercontent.com/assets/15959626/22045854/0fc4f148-dd04-11e6-9e4d-fd60504fc2d5.jpg)\n\n---\n\n```bash\npycrusher crusher.png -i 10 -e 5\n```\n\n**Default output filename:**   compressions/crusher_i10e5.png\n\n![compressed_crusher1](https://cloud.githubusercontent.com/assets/15959626/22045717/1883c198-dd03-11e6-9e76-4a6cb20c0413.jpg)\n\n---\n\n```bash\npycrusher crusher.png -i 20 -c 4\n```\n\n**Default output filename:**  compressions/crusher_i20e1c[4.0].png\n\n![compressed_crusher7](https://cloud.githubusercontent.com/assets/15959626/22045906/63ef3a76-dd04-11e6-9ed0-4080a7c92ab9.jpg)\n\n---\n\n```bash\npycrusher crusher.png -i 20 -c 4 -r\n```\n\n**Default output filename:** compressions/crusher_i20e1rc[4.0].png\n\n![compressed_crusher5](https://cloud.githubusercontent.com/assets/15959626/22492147/6bc72270-e80f-11e6-8e64-fa678fa03b0a.png)\n\n---\n\n```bash\npycrusher crusher.png -i 20 -c 4 0\n```\n\n**Default output filename:**  compressions/crusher_i20e1c[4.0,0.0].png\n\n![compressed_crusher5](https://cloud.githubusercontent.com/assets/15959626/22045830/d62aae5a-dd03-11e6-8efd-a3fb90b42f0b.jpg)\n\n---\n\n```bash\npycrusher crusher.png -i 20 -c 4 0 -p\n```\n\n**Default output filename:**  compressions/crusher_i20e1pc[4.0,0.0].png\n\n![compressed_crusher1](https://cloud.githubusercontent.com/assets/15959626/22492096/1640df30-e80f-11e6-94b5-3adedc6771b4.png)\n\n## License\n\nApache License 2.0\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Generate lossy JPEG compressions for fun!",
    "version": "0.3.11",
    "project_urls": {
        "Issues": "https://github.com/jonesmartins/pycrusher/issues",
        "Repository": "https://github.com/jonesmartins/pycrusher"
    },
    "split_keywords": [
        "image processing",
        " jpeg",
        " lossy compression"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6e81aceac44be120cd9622bf4160c30b6aebc4d54878a8baca28c2e4d42f5b66",
                "md5": "63b1de532108e328c40b9b78a4123bc1",
                "sha256": "ea01b22067bf6ae54bed11a85bf14362efc48b4fd54b46ecd44060de7e6b1e4b"
            },
            "downloads": -1,
            "filename": "pycrusher-0.3.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63b1de532108e328c40b9b78a4123bc1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10426,
            "upload_time": "2024-10-18T13:51:52",
            "upload_time_iso_8601": "2024-10-18T13:51:52.487523Z",
            "url": "https://files.pythonhosted.org/packages/6e/81/aceac44be120cd9622bf4160c30b6aebc4d54878a8baca28c2e4d42f5b66/pycrusher-0.3.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "551eb3f87da594bd04e44ab986a70a8d32045796ed513f5cfbd1b676b50f1780",
                "md5": "8186de25bc0fafcf6f624f87da4593ca",
                "sha256": "a4da28f04ab162a028cd009564950e48886746a4de536c702b86bd03ea37f78b"
            },
            "downloads": -1,
            "filename": "pycrusher-0.3.11.tar.gz",
            "has_sig": false,
            "md5_digest": "8186de25bc0fafcf6f624f87da4593ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12241,
            "upload_time": "2024-10-18T13:51:54",
            "upload_time_iso_8601": "2024-10-18T13:51:54.125155Z",
            "url": "https://files.pythonhosted.org/packages/55/1e/b3f87da594bd04e44ab986a70a8d32045796ed513f5cfbd1b676b50f1780/pycrusher-0.3.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-18 13:51:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jonesmartins",
    "github_project": "pycrusher",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "pycrusher"
}
        
Elapsed time: 0.38708s