moondream icon indicating copy to clipboard operation
moondream copied to clipboard

Add PIL fallback for image resizing

Open vikhyat opened this issue 11 months ago • 0 comments

This PR adds a fallback to PIL/Pillow for image resizing when PyVips is not available. Changes include:

  • Modified image_crops.py to use PIL when PyVips import fails
  • Added comprehensive tests to verify both PyVips and PIL implementations produce similar results
  • Test results show max pixel difference of 2.0 and mean difference of 0.27 between implementations

This change makes the library more accessible to users who may not have PyVips installed.

vikhyat avatar Jan 26 '25 01:01 vikhyat