properjpg


Nameproperjpg JSON
Version 0.3.6 PyPI version JSON
download
home_pagehttps://github.com/vitorrloureiro/properjpg
SummaryCLI tool to convert almost any image to optimized JPEGs.Fast.
upload_time2024-05-17 00:11:15
maintainerNone
docs_urlNone
authorVitor Loureiro
requires_python<4.0,>=3.10
licenseMIT
keywords image optimize jpg conversor web cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. |pypi| image:: https://img.shields.io/pypi/v/properjpg
.. |pythonver| image:: https://img.shields.io/pypi/pyversions/properjpg
.. |downloads| image:: https://img.shields.io/pypi/dm/properjpg
.. |build| image:: https://img.shields.io/github/workflow/status/vitorrloureiro/properjpg/Tests
.. |cov| image:: https://img.shields.io/codecov/c/github/vitorrloureiro/properjpg
.. |wheel| image:: https://img.shields.io/pypi/wheel/properjpg
.. |license| image:: https://img.shields.io/pypi/l/properjpg


ProperJPG
=========

*Convert images to optimized JPEGs. Fast.*

|

|pypi| |pythonver| |build| |cov| |wheel| |downloads| |license|

ProperJPG is a super fast, lightweight CLI app that converts and compress images to optimized jpg.If you like, it can also resize them!

If you need a tool to batch convert and optimize images
making them "ready for the web", this may be the tool for you.

It works by accepting almost all image formats and converting them to JPEG, while compressing and stripping metadata in the process.

ProperJPG allows you to set a max width/height so any images that crosses the threshold is atuomatically resized while keeping the correct aspect ratio.

It also allows you to input a folder with multiple images. In this case, ProperJPG clones the original folder structure in the output path.



**Actively soliciting contributors!**

Feel free to open a pull request in case you find an issue or a way to improve the 
app. New features are also welcome, considering they don't add unecessary complexity to the
user experience.

Installation
------------

- `Regular`_
- `Developer`_

Regular
~~~~~~~
**Pipx (recommended)**
   
::

   pipx install properjpg

**Pip**

::

   pip install properjpg

Developer
~~~~~~~~~
**Poetry**

::

   poetry add properjpg

**Git**

::

   git clone https://github.com/vitorrloureiro/properjpg

Features
--------

- `Smart resize`_
- `Multiprocessing`_
- `Progressive JPG`_

Smart resize
~~~~~~~~~~~~

It has a super cool 'smart resize' functionality.
It allows you to set a max width and height, and you can be sure that
every image compressed by it will be no larger or taller than what you
specify. This 'smart resize' mode makes sure to don't resize images
that doesn't need to, and also takes in account if it's best for an
image to be resized based on it's width or height.

Progressive JPG
~~~~~~~~~~~~~~~

Images are saved as progressive JPEG as default. You can disable this behaviour
with `-np` flag. Learn more `here <https://www.thewebmaster.com/develop/articles/how-progressive-jpegs-can-speed-up-your-website/>`_

Multiprocessing
~~~~~~~~~~~~~~~

This app uses the multiprocessing module to leverage all the power on your computer.
It'll work faster if you have multiple cores.

How does it work?
-----------------
**This app works in two modes:**

- `"Single file" mode`_
- `"Directory" mode`_

"Single file" mode
~~~~~~~~~~~~~~~~~~
Input an image path and the desired output path.

Basic usage:
   
::

   properjpg [input_path] [output_path] -wi=[max_width] -he=[max_height]


"Directory" mode
~~~~~~~~~~~~~~~~
This is where this app really shines. Input a directory path and a desired destination
path and the app will clone the folder struct of the original directory on the output path.
Then it will look for all images in the input folder and will try to convert (and
resize, if you setted it to) them.

ProperJPG uses multiprocessing to speed up the process.

Basic usage:

::

   properjpg [input_path] [output_path] -d -wi=[max_width] -he=[max_height]


Commands
--------

-h    Shows the help screen.
-d    Turns on directory mode.
-o    If set, the encoder will make an extra pass in order to select optimal encoder settings.
-q    If set, the input will be compressed to the set value (using Pillow library). Choose a value from 1 to 95.
-np   If set, disables progressive jpeg and saves as baseline instead.
-wi   Sets the max width.
-he   Sets the max height.
-re   Turns on "reduce" mode and set the factore to which the images are to be resized.
-v    Shows ProperJPG's version.





Notes
-----
This software is in Alpha stage. A lot of things may change, including syntax and dependencies. I'm looking for help
to improve this tool in terms of speed, features and code readability. Feel free to make suggestions and improvements!.
Also feel free to help me improve the tests 😅

The goal is to always keep the code with 100% test coverage.

Contributing
------------

Requirements
~~~~~~~~~~~~

This repository automatically lints code with flake8 and black, and also runs mypy
and pytest. Pull requests must pass in all those tests.

- `black <https://github.com/psf/black>`_
- `flake8 <https://github.com/PyCQA/flake8>`_
- `mypy <https://github.com/python/mypy>`_
- `pytest <https://github.com/pytest-dev/pytest>`_

Roadmap
~~~~~~~

- Improve UI (maybe switch to Click? Add Colorama?).
   - Add a better progress view when using `"Directory" Mode`_
- Improve testing.
- Improve Docs.
- Improve Performance.

Known Issues
~~~~~~~~~~~~

Client
......
- None

Dev
...
- 100% coverage, but tests are a mess.
- Improve GitHub Action.
- Create a workflow for :code:`poetry publish --build`

License
-------
**MIT**

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vitorrloureiro/properjpg",
    "name": "properjpg",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "image, optimize, jpg, conversor, web, cli",
    "author": "Vitor Loureiro",
    "author_email": "miseravel.cruller-0o@icloud.com",
    "download_url": "https://files.pythonhosted.org/packages/6a/0d/a8d06f88cc8b126560b69ea2f0fe81939f7e359c56621e8799fba72b7688/properjpg-0.3.6.tar.gz",
    "platform": null,
    "description": ".. |pypi| image:: https://img.shields.io/pypi/v/properjpg\n.. |pythonver| image:: https://img.shields.io/pypi/pyversions/properjpg\n.. |downloads| image:: https://img.shields.io/pypi/dm/properjpg\n.. |build| image:: https://img.shields.io/github/workflow/status/vitorrloureiro/properjpg/Tests\n.. |cov| image:: https://img.shields.io/codecov/c/github/vitorrloureiro/properjpg\n.. |wheel| image:: https://img.shields.io/pypi/wheel/properjpg\n.. |license| image:: https://img.shields.io/pypi/l/properjpg\n\n\nProperJPG\n=========\n\n*Convert images to optimized JPEGs. Fast.*\n\n|\n\n|pypi| |pythonver| |build| |cov| |wheel| |downloads| |license|\n\nProperJPG is a super fast, lightweight CLI app that converts and compress images to optimized jpg.If you like, it can also resize them!\n\nIf you need a tool to batch convert and optimize images\nmaking them \"ready for the web\", this may be the tool for you.\n\nIt works by accepting almost all image formats and converting them to JPEG, while compressing and stripping metadata in the process.\n\nProperJPG allows you to set a max width/height so any images that crosses the threshold is atuomatically resized while keeping the correct aspect ratio.\n\nIt also allows you to input a folder with multiple images. In this case, ProperJPG clones the original folder structure in the output path.\n\n\n\n**Actively soliciting contributors!**\n\nFeel free to open a pull request in case you find an issue or a way to improve the \napp. New features are also welcome, considering they don't add unecessary complexity to the\nuser experience.\n\nInstallation\n------------\n\n- `Regular`_\n- `Developer`_\n\nRegular\n~~~~~~~\n**Pipx (recommended)**\n   \n::\n\n   pipx install properjpg\n\n**Pip**\n\n::\n\n   pip install properjpg\n\nDeveloper\n~~~~~~~~~\n**Poetry**\n\n::\n\n   poetry add properjpg\n\n**Git**\n\n::\n\n   git clone https://github.com/vitorrloureiro/properjpg\n\nFeatures\n--------\n\n- `Smart resize`_\n- `Multiprocessing`_\n- `Progressive JPG`_\n\nSmart resize\n~~~~~~~~~~~~\n\nIt has a super cool 'smart resize' functionality.\nIt allows you to set a max width and height, and you can be sure that\nevery image compressed by it will be no larger or taller than what you\nspecify. This 'smart resize' mode makes sure to don't resize images\nthat doesn't need to, and also takes in account if it's best for an\nimage to be resized based on it's width or height.\n\nProgressive JPG\n~~~~~~~~~~~~~~~\n\nImages are saved as progressive JPEG as default. You can disable this behaviour\nwith `-np` flag. Learn more `here <https://www.thewebmaster.com/develop/articles/how-progressive-jpegs-can-speed-up-your-website/>`_\n\nMultiprocessing\n~~~~~~~~~~~~~~~\n\nThis app uses the multiprocessing module to leverage all the power on your computer.\nIt'll work faster if you have multiple cores.\n\nHow does it work?\n-----------------\n**This app works in two modes:**\n\n- `\"Single file\" mode`_\n- `\"Directory\" mode`_\n\n\"Single file\" mode\n~~~~~~~~~~~~~~~~~~\nInput an image path and the desired output path.\n\nBasic usage:\n   \n::\n\n   properjpg [input_path] [output_path] -wi=[max_width] -he=[max_height]\n\n\n\"Directory\" mode\n~~~~~~~~~~~~~~~~\nThis is where this app really shines. Input a directory path and a desired destination\npath and the app will clone the folder struct of the original directory on the output path.\nThen it will look for all images in the input folder and will try to convert (and\nresize, if you setted it to) them.\n\nProperJPG uses multiprocessing to speed up the process.\n\nBasic usage:\n\n::\n\n   properjpg [input_path] [output_path] -d -wi=[max_width] -he=[max_height]\n\n\nCommands\n--------\n\n-h    Shows the help screen.\n-d    Turns on directory mode.\n-o    If set, the encoder will make an extra pass in order to select optimal encoder settings.\n-q    If set, the input will be compressed to the set value (using Pillow library). Choose a value from 1 to 95.\n-np   If set, disables progressive jpeg and saves as baseline instead.\n-wi   Sets the max width.\n-he   Sets the max height.\n-re   Turns on \"reduce\" mode and set the factore to which the images are to be resized.\n-v    Shows ProperJPG's version.\n\n\n\n\n\nNotes\n-----\nThis software is in Alpha stage. A lot of things may change, including syntax and dependencies. I'm looking for help\nto improve this tool in terms of speed, features and code readability. Feel free to make suggestions and improvements!.\nAlso feel free to help me improve the tests \ud83d\ude05\n\nThe goal is to always keep the code with 100% test coverage.\n\nContributing\n------------\n\nRequirements\n~~~~~~~~~~~~\n\nThis repository automatically lints code with flake8 and black, and also runs mypy\nand pytest. Pull requests must pass in all those tests.\n\n- `black <https://github.com/psf/black>`_\n- `flake8 <https://github.com/PyCQA/flake8>`_\n- `mypy <https://github.com/python/mypy>`_\n- `pytest <https://github.com/pytest-dev/pytest>`_\n\nRoadmap\n~~~~~~~\n\n- Improve UI (maybe switch to Click? Add Colorama?).\n   - Add a better progress view when using `\"Directory\" Mode`_\n- Improve testing.\n- Improve Docs.\n- Improve Performance.\n\nKnown Issues\n~~~~~~~~~~~~\n\nClient\n......\n- None\n\nDev\n...\n- 100% coverage, but tests are a mess.\n- Improve GitHub Action.\n- Create a workflow for :code:`poetry publish --build`\n\nLicense\n-------\n**MIT**\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CLI tool to convert almost any image to optimized JPEGs.Fast.",
    "version": "0.3.6",
    "project_urls": {
        "Documentation": "https://github.com/vitorrloureiro/properjpg",
        "Homepage": "https://github.com/vitorrloureiro/properjpg",
        "Repository": "https://github.com/vitorrloureiro/properjpg"
    },
    "split_keywords": [
        "image",
        " optimize",
        " jpg",
        " conversor",
        " web",
        " cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e70286c26f73ce319e17654ddec5cb83b21c618507945e2be2de5c5a60a2f6d9",
                "md5": "8302b67332b6d5370edc1e55639ee627",
                "sha256": "037570ae97ba5edd88c5063f70a7e2ab435644c6a1a5784126fc22264724cdbe"
            },
            "downloads": -1,
            "filename": "properjpg-0.3.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8302b67332b6d5370edc1e55639ee627",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 8528,
            "upload_time": "2024-05-17T00:11:13",
            "upload_time_iso_8601": "2024-05-17T00:11:13.502068Z",
            "url": "https://files.pythonhosted.org/packages/e7/02/86c26f73ce319e17654ddec5cb83b21c618507945e2be2de5c5a60a2f6d9/properjpg-0.3.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a0da8d06f88cc8b126560b69ea2f0fe81939f7e359c56621e8799fba72b7688",
                "md5": "ab99411c54e0e1b36ecc9e18f778e5f9",
                "sha256": "e70765a37f70279e2257e16b71caa575d48940da26890ce621b8f70fb4f632da"
            },
            "downloads": -1,
            "filename": "properjpg-0.3.6.tar.gz",
            "has_sig": false,
            "md5_digest": "ab99411c54e0e1b36ecc9e18f778e5f9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 7105,
            "upload_time": "2024-05-17T00:11:15",
            "upload_time_iso_8601": "2024-05-17T00:11:15.417296Z",
            "url": "https://files.pythonhosted.org/packages/6a/0d/a8d06f88cc8b126560b69ea2f0fe81939f7e359c56621e8799fba72b7688/properjpg-0.3.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-17 00:11:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vitorrloureiro",
    "github_project": "properjpg",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "properjpg"
}
        
Elapsed time: 0.37894s