Skip to content

autocrop 2.0.0

Latest

Choose a tag to compare

@leblancfg leblancfg released this 19 Oct 00:22
· 1 commit to master since this release
5f9f60c

autocrop 2.0.0 is a breaking release for face-aware image cropping from Python and the shell.

  • Cropper.crop() returns a typed CropResult: read .image for the crop and .diagnostics for that attempt.
  • The CLI processes one image at a time, supports stdin/stdout pipelines, and writes safe JSON reports with --json.
  • Use align=True or --align to rotate faces so they're level using eye landmarks before cropping.
  • YuNet replaces Haar detection. Automatic brightening and directory-scanning mode are removed.
  • Tested on Python 3.10–3.15 across Linux, macOS, and Windows. Requires OpenCV 4.8+ and Pillow 12.3.0+.

Upgrading from v1

Python: replace image = cropper.crop(source) with image = cropper.crop(source).image and check that image for None.

CLI: replace directory-mode commands with a shell loop; choose an output format with -o cropped.png. Use -V or --version for the version; -v now enables timings.

Read the migration FAQ before upgrading. It covers removed APIs, error messages, rollback, and changes to pixels/colors. The API docs also list the SDK limitations deferred to follow-up work, including input-array mutation with resize=False; pass a copy when reusing arrays.

python -m pip install --upgrade 'autocrop==2.0.0'

Documentation · Full changelog