novitai / skycompress

Compress the image with binary search algorithm to find best fit dimension and quality
1 stars 0 forks source link

Test and fix brokens #6

Closed Gozgur closed 10 months ago

Gozgur commented 10 months ago

What's New?

:star2: New Test Cases for Image Compression :star2:

  1. Basic Compression Test:

    • Verifies basic functionality by compressing a random image.
    • Checks if the output is produced.
    • Validates the type of the output as a numpy array.
    • Ensures the compressed result stays within the given byte limit.
  2. Different Image Shapes:

    • Tests the compression on:
      • Square images.
      • Landscape-oriented rectangular images.
      • Portrait-oriented rectangular images.
  3. Varied Image Formats:

    • Adds tests for different color formats:
      • RGB
      • Greyscale
      • Binary
  4. Edge Cases:

    • Compression of exceptionally small images.
    • Verifies the compression output when given a significantly large byte limit.
    • Checks the limits of compression when given an extremely low byte limit (as low as 10 bytes!).

_These tests ensure that the compress_image function from the skycompress module handles a variety of image shapes, formats, and edge cases reliably. Through this, we aim to provide robustness to the image compression functionality._