Skip to content

Add Native HEIC Support and Fix EXIF Orientation#17

Merged
kocabiyik merged 3 commits into
withoutbg:mainfrom
Kundan-Krishna366:feature/heic-support
Apr 13, 2026
Merged

Add Native HEIC Support and Fix EXIF Orientation#17
kocabiyik merged 3 commits into
withoutbg:mainfrom
Kundan-Krishna366:feature/heic-support

Conversation

@Kundan-Krishna366

@Kundan-Krishna366 Kundan-Krishna366 commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds native support for HEIC/HEIF image formats (commonly used by iOS devices) and addresses an issue where mobile uploads appear incorrectly rotated in the processed output.

Key Changes:

  • HEIF/HEIC Support: Integrated pillow-heif to enable decoding of Apple-native image formats in the FastAPI backend.
  • Orientation Correction: Implemented ImageOps.exif_transpose to ensure images respect their original EXIF orientation metadata before processing.
  • Pipeline Standardization: Forced RGBA conversion to ensure consistency across all inference models.
  • Documentation: Updated remove_background_endpoint docstrings to follow the project's Google-style standard.

Type of Change

  • feat - New feature (MINOR version bump)
  • fix - Bug fix (PATCH version bump)
  • docs - Documentation only
  • style - Code style/formatting

Checklist

  • My commit messages follow the Conventional Commits format.
  • I have updated the documentation (Docstrings in main.py).
  • All tests are passing locally on Arch Linux.
  • My code follows the project's style guidelines (black + ruff).

Related Issues

Closes #7


Testing

Verified locally using uv on Arch Linux (Python 3.12):

  1. Format Support: Uploaded .heic files via Swagger UI and confirmed successful processing.
  2. Orientation: Confirmed that Portrait-mode photos are correctly oriented in the output.
  3. Stability: Verified that standard .png and .jpg processing remains unaffected.

Screenshots

Successful HEIC Processing (Swagger UI):

Screenshot From 2026-03-20 14-59-51

📝 Note: When this PR is merged to main, an automated release will be triggered based on your commit messages.

@kocabiyik
kocabiyik merged commit 3d7e30d into withoutbg:main Apr 13, 2026
@Kundan-Krishna366
Kundan-Krishna366 deleted the feature/heic-support branch April 14, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: HEIC Support

2 participants