py-oiio
py-oiio copied to clipboard
Python OpenImageIO (OIIO)
py-oiio
Python wheels for OpenImageIO
Currently just a simple explainer on how to create a usable Python module.
Usage
import oiio
from oiio import ImageInput, ImageOutput
from oiio import ImageBuf, ImageSpec, ImageBufAlgo
Everything else should be the same as in the official OIIO documentation.
Windows build steps
- Get vcpkg and run script to install.
- Install OpenImageIO with
./vcpkg install openimageio[pybind11]:x64-windows. - Copy the
vcpkg\installed\x64-windows\lib\python3.10\site-packages\OpenImageIO.cp310-win_amd64.pydfile to theoiiofolder. - Copy DLLs from
vcpkg\installed\x64-windows\binto theoiiofolder. - Rename the .pyd file to
OpenImageIO.pyd. - (Optional)
python3 -m pip install mypythen runstubgen -m OpenImageIO -o ./to generate a .pyi stub for code completion. (Thanks, @pixel-ninja)
Releasing on PyPI
- Follow the above steps to build OpenImageIO for Python
- Navigate to the root directory
- Run
py -m build - Then run
twine upload dist/*and follow the prompts.
License
Licensed under the MIT license.