Skip to content

fazeelibtesam/Extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Extractor


A lightweight and easy-to-use Python tool to convert .mat (MATLAB) files into .jpg image files. Useful for data preprocessing, machine learning pipelines, or visualization purposes.

πŸ“Œ Features

  • Converts 2D .mat arrays into .jpg images
  • Batch processing support
  • Custom output directory
  • Normalizes pixel values (0–255)
  • CLI-based usage for ease of automation

πŸ“‚ Example

Input .mat file:

Output .jpg image:

Grayscale image where pixel values are scaled based on the matrix.

πŸ”§ Requirements

  • Python 3.7+
  • scipy
  • numpy
  • Pillow

πŸ“₯ Installation

git clone https://github.com/fazeelibtesam/Extractor.git
cd Extractor
pip install -r requirements.txt

πŸš€ Usage

python mat_to_jpg.py --input_dir ./mat_files --output_dir ./jpg_output

πŸ—‚οΈ Project Structure

mat-to-jpg-converter/
β”‚
β”œβ”€β”€ examples/               # Sample .mat files and output images
β”œβ”€β”€ README.md               # Documentation
β”œβ”€β”€ mat_to_jpg.py           # Main script
└── requirements.txt        # Dependencies

πŸ› οΈ Notes

  • Make sure the .mat files contain 2D arrays for image conversion.
  • Use --key if the variable name inside the .mat file is not obvious.

🀝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

πŸ“„ License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Feel free to fork, star ⭐, and follow for updates!


About

Python script to convert .mat file to jpg

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published