AL
aliemo/hsv-mask-tool
A simple Python GUI tool for visualizing and creating HSV masks on images.
HSV Mask Tool
A simple Python GUI tool for visualizing and creating HSV masks on images.
Adjust Hue, Saturation, and Value ranges, save masked images, and export mask settings to CSV.
Features
- Load a folder of images (
.jpg,.png,.jpeg,.bmp). - Default folder:
sampledata(loaded automatically if exists). - Adjust HSV ranges with interactive sliders.
- Toggle mask background between black and white.
- Navigate images with Prev/Next buttons.
- Save mask settings in memory and export to CSV.
- Save masked images with
_maskedsuffix. - Application window icon support.
Requirements
- Python 3.10+
- PyQt5
- OpenCV (
opencv-python-headless) - NumPy
Install dependencies:
pip install -r requirements.txtProject Structure
HSVMaskTool/
│
├─ HSVMaskTool.py # Main application
├─ sampledata/ # Default images (optional)
├─ res/
│ └─ icons/
│ └─ icon.png # Application icon
├─ README.md
└─ requirements.txtUsage
- Option 1: Run executable version
HSVMaskTool- Option 2: Run in python
python HSVMaskTool.py-
Load Default Images:
If a folder named sampledata exists in the project directory, it will be loaded automatically. -
Load Another Folder:
Click the Load Folder button to choose a different folder with images. -
Save Mask Settings:
- Click Save Mask to save the current HSV settings for the displayed image.
- Click Export CSV to save all saved mask settings to a CSV file.
-
Save Masked Image
Click Save Masked Image to save the masked image with the original filename plus _masked.
Notes
- Masked images and CSV files are saved in the current working directory.
- Ensure the sampledata folder exists if you want default images to load.
Developer Guide
Packaging with PyInstaller
pyinstaller HSVMaskTool.spec- Windows: .exe executable
- Unix: binary executable
- Make sure
res/icons/icon.pngand sampledata folder are included in the.specfile as datas. - For Windows, convert
icon.pngto.icofor proper.exeicon display.
On this page
Contributors
Latest Release
v1.0December 13, 2025MIT License
Created December 13, 2025
Updated December 13, 2025