Converts and optimizes images and 3D models
Go to file
Fabien LOISON ea76ed0d2d
feat: Added scripts to build a redistribuable Linux binary
2024-03-20 14:04:17 +01:00
.github Bump pypa/cibuildwheel from 2.16.5 to 2.17.0 2024-03-18 05:21:28 +00:00
assimp@6a08c39e3a Updated assimp 2024-01-06 16:44:56 +01:00
doc docs: Added MozJPEG to the list of used optimization libraries 2024-02-12 09:53:38 +01:00
linux-bin feat: Added scripts to build a redistribuable Linux binary 2024-03-20 14:04:17 +01:00
scripts chore: Removed listing of all c/c++ and assimp source from MANIFEST.in as it is no more required. Also removed the script that updated this file 2024-01-06 16:39:30 +01:00
test Fix typos and add codespell to nox 2022-10-18 00:29:42 +08:00
winbuild docs: Updated winbuild docs and distributed Windows README 2024-03-20 13:55:08 +01:00
yoga chore: Fixed coding style according to Black 24.x 2024-01-29 09:31:16 +01:00
.flake8 Updates Black and Flake8 config 2021-04-06 15:58:23 +02:00
.gitattributes Update windows build script and add a README and a license to the dist dir 2020-05-06 15:33:19 +02:00
.gitignore feat: Added scripts to build a redistribuable Linux binary 2024-03-20 14:04:17 +01:00
.gitmodules Using HTTPS so that Travis is happy 2018-01-17 15:42:51 +01:00
LICENSE v1.3.0 2024-01-06 16:56:39 +01:00
MANIFEST.in chore(sdist): Fixed included files in sdist package 2024-01-07 11:55:26 +01:00
README.rst docs: Added MozJPEG to the list of used optimization libraries 2024-02-12 09:53:38 +01:00
RELEASE.rst v1.3.0 2024-01-06 16:56:39 +01:00
logo.png logo 2018-01-15 17:11:24 +01:00
noxfile.py docs: Documented how to update assimp 2024-01-06 16:44:25 +01:00
pyproject.toml Added Python 3.12 support and dropped Python 3.7 support 2023-10-06 11:29:45 +02:00
requirements.dev.txt Update dependencies 2022-06-27 11:49:05 +02:00
requirements.txt Update dependencies 2022-06-27 11:49:05 +02:00
setup.py v1.3.1 2024-01-07 11:57:21 +01:00

README.rst

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

YOGA - Yummy Optimizer for Gorgeous Assets
==========================================

|Github| |Discord| |PYPI Version| |Build Status| |Black| |License|

.. figure:: https://github.com/wanadev/yoga/raw/master/logo.png
   :alt:

**YOGA** is a command-line tool and a library that can:

* convert and optimize images from various format to JPEG, PNG and WEBP,
* convert and optimize 3D models from various formats to `glTF and GLB`_.

**Images** are opened using Pillow_ and optimized using Guetzli_ and MozJPEG_
for JPEGs, Zopflipng_ for PNGs and libwebp_ for WEBPs.

**3D Models** are converted and optimized using assimp_. If models contain or
reference images, they are processed by YOGA's image optimizer.

EXAMPLE: Converting and optimizing an image from CLI::

    yoga  image  input.png  output.png
    yoga  image  --output-format=jpeg  --jpeg-quality=84  input.png  output.jpg
    yoga  image  --help

EXAMPLE: Converting and optimizing a 3D model from CLI::

    yoga  model  input.fbx  output.glb
    yoga  model  --no-graph-optimization  --no-meshes-optimization  --image-output-format=jpeg  --image-jpeg-quality=84  input.fbx  output.glb
    yoga  model  --help

.. _glTF and GLB: https://www.khronos.org/gltf/
.. _Pillow: https://github.com/python-pillow/Pillow
.. _Guetzli: https://github.com/google/guetzli
.. _MozJPEG: https://github.com/mozilla/mozjpeg
.. _Zopflipng: https://github.com/google/zopfli
.. _libwebp: https://chromium.googlesource.com/webm/libwebp/
.. _assimp: https://github.com/assimp/assimp


Install
-------

* See `the install section of the documentation <https://wanadev.github.io/yoga/install.html>`_


Documentation
-------------

* `Command Line Interface (CLI) <https://wanadev.github.io/yoga/cli/index.html>`_
* `Python API <https://wanadev.github.io/yoga/python/index.html>`_
* `Contributing <https://wanadev.github.io/yoga/contributing.html>`_


Changelog
---------

* **[NEXT]** (changes on ``master`` that have not been released yet):

  * Nothing yet ;)

* **v1.3.1:**

  * chore(sdist): Fixed included files in sdist package (@flozz)

* **v1.3.0:**

  * feat(assimp): Updated assimp to v5.3.1 (fixed build on GCC >= 13) (@flozz)
  * chore: Removed a script that is no more needed (@flozz)
  * docs: Updated contributing documentation (libraries, supported Python
    version, assimp update) (@flozz)

* **v1.2.3:**

  * Code quality: more robust type comparison (@flozz)
  * Code quality: cleanup some Python 2.7 specific code (@flozz)
  * Added Python 3.12 support (@flozz)
  * Removed Python 3.7 support (@flozz)

* **v1.2.2:**

  * Updated the code to not use deprecated constants on newer Pillow versions
  * Various typo fixed (@kianmeng, #45)
  * Added Python 3.11 support

* **v1.2.1:**

  * No change: fix an upload error on PYPI

* **v1.2.0:**

  * Add color quantization options (based on libimagequant)
  * ``arm64`` and ``universal2`` wheels for macOS
  * ``x86`` and ``x68_64`` wheels for musl-based Linux distro (Alpine,...)
  * **MAINTAINERS:** New dependency: `imagequant <https://github.com/wanadev/imagequant-python>`_

* **v1.1.2:**

  * Add flag to CFFI builder to fix MacOS build

* **v1.1.1 (not published):**

  * JPEG: ignore invalid values for the orientation tag (#38)
  * Python 3.10 support and wheels

* **v1.1.0:**

  * **JPEG Optimization:**

    * Honor the JPEG orientation EXIF tag
    * JPEG optimization has been improved by using some optimizations from
      MozJPEG after the Guetzli encoding (from 2.4 % to 7.3 % of additional size
      reduction)

  * **PNG Optimization:**

    * YOGA can no more output a PNG larger than the input one when performing
      a PNG to PNG optimization

  * **CLI:**

    * Allow to cancel an optimization using Ctrl+C (NOTE: may not work on
      Windows)
    * Add a ``--version`` option to get YOGA's version
    * Improve ``yoga --help`` usage

  * **Python versions:**

    * Python 2.7 support dropped

  * **NOTE for packagers:**

    * new dependency to `mozjpeg-lossless-optimization
      <https://github.com/wanadev/mozjpeg-lossless-optimization>`_

* **v1.0.0:**

  * WEBP (lossy and lossless) images supported as output format
  * PNG default optimization preset changed to a 10× faster preset (old preset
    still available with ``--png-slow-optimization`` flag)
  * New model flag ``--no-fix-infacing-normals`` to disable Assimp's "fix
    infacing normals" postprocess (#32, #33)
  * Show CLI usage when no parameter given
  * Developer documentation improved (#31)
  * ASSIMP library updated
  * WARNING: This is the last version to actively support Python 2.7!

* **v0.11.1:**

  * Automated workflow for deploying the PyPI packages
  * Wheel are now distributed on PyPI

* **v0.11.0:**

  * Allows to build YOGA on Windows
  * Scripts and workflow to build Windows standalone versions

* **v0.10.2:**

  * Updates assimp and python libraries

* **v0.10.1:**

  * Fixes an issue that occurs when output file does not already exist

* **v0.10.0:**

  * Prevent overwriting of the output file when an error occurs (#17)
  * Unicode path support (#16)

* **v0.10.0b1:**

  * Verbose and quiet modes,
  * Allows to pass textures from memory instead of looking on the filesystem,
  * Allows to pass a fallback texture instead of raising an error.

* **v0.9.1b1:**

  * Automatic selection of the output format (png or jpeg),
  * Prevent duplication of textures that are shared between materials,
  * Fixes Windows paths of textures.

* **v0.9.0b1:** First release (only GLB output for models, no image auto
  output format)


.. |Github| image:: https://img.shields.io/github/stars/wanadev/yoga?label=Github&logo=github
   :target: https://github.com/wanadev/yoga
.. |Discord| image:: https://img.shields.io/badge/chat-Discord-8c9eff?logo=discord&logoColor=ffffff
   :target: https://discord.gg/BmUkEdMuFp
.. |PYPI Version| image:: https://img.shields.io/pypi/v/yoga.svg
   :target: https://pypi.python.org/pypi/yoga
.. |Build Status| image:: https://github.com/wanadev/yoga/workflows/Python%20CI/badge.svg
   :target: https://github.com/wanadev/yoga/actions
.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://black.readthedocs.io/en/stable/
.. |License| image:: https://img.shields.io/pypi/l/yoga.svg
   :target: https://github.com/wanadev/yoga/blob/master/LICENSE