Team Ai
Apppublic

Lionelxt/Image_processor

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

Key Components:

This app has been deployed to Hugging Face: https://huggingface.co/spaces/Lionelxt/Image_processor

ImageProcessor Class: The central class that handles all image processing operations.

  1. 1.Constructor: Accepts either a file path or an image array, adding flexibility in how images can be loaded.
  1. 1.Validation Methods: validate_image() ensures the image is properly loaded and in the correct format.
  1. 1.Filter Methods: Each filter (grayscale, brightness adjustment, flip, isolate-red, blur, cartoonize, sepia) is implemented as a separate method within the class, providing clean separation of concerns.
  1. 1.Utility Methods: displayimage() and saveimage() handle image output operations.

Driver:

  1. 1.load image
  2. 2.display unprocessed image
  3. 3.display the filters menu
  4. 4.process image
  5. 5.display the processed image
  6. 6.ask user to save or not

Filters:

  1. 1.Grayscale: converts the image to grey scale using weighted conversion
  2. 2.Brightness Adjustment adjusts the brightness of the image
  3. 3.Fillip flips the image horizontally or vertically
  4. 4.Isolate_red Converts the image to grayscale but preserves red colors
  5. 5.Blur Applies Gaussian blur to the image with a customizable radius parameter
  6. 6.Cartoonize Transforms the image into a cartoon-like effect by extracting edge information and simplifying colors
  7. 7.Sepia Applies a warm, vintage sepia tone to the image

Design desitions: Process the input loop outside the funtion: Imagine that driver and class two files will be handled by different people, functions in class should raises clear, specific errors that can be caught and handled by whoever is using the image_driver.py file

process all the input validation before calling the funtions in class with parameters

Challenges: One of the challenge is to test the filters. I implement a small pitch of pixels to examine if filter works as expected