This repository contains two Python scripts designed for image processing and color transformation tasks. The scripts utilize advanced color science techniques to analyze and modify images in various color spaces.
RGBFL_FL.py
: This script focuses on reading color measurement data, interpolating colors, and visualizing the relationship between image colors and lighting conditions to optimize color accuracy.RGBFL_GM.py
: A tool for converting images using a color lookup table (LUT) and nearest neighbor interpolation within the LAB color space, aiming to enhance image quality through precise color adjustments.
Before running the scripts, ensure you have the following dependencies installed:
- Python 3.6 or newer
- OpenCV (
cv2
) - NumPy
- Pandas
- Matplotlib
- Scipy
- colour-science
- tqdm
- logging
- multiprocessing
You can install these dependencies using pip:
pip install numpy opencv-python pandas matplotlib scipy colour-science tqdm
- Ensure you have an Excel file with color measurement data and an image file you want to process.
- Modify the
image_path
anddata_file_path
variables in the script to point to your files. - Run the script:
python RGBFL_FL.py
This will generate output that includes interpolated color values and visualization plots comparing the image and lighting condition color gamuts.
- Prepare a LUT file and an image file for processing.
- Set the
image_filename
andlut_filename
variables in the script to your specific files. - Execute the script:
python RGBFL_GM.py
The script will apply the LUT to the image using multiprocessing for efficient color translation and save the output image.
- The scripts generate logs and output images in specified directories; ensure these exist or modify the script to your directory structure.
- You might need to adjust file paths and parameters based on your project's requirements.
Feel free to fork this repository and submit pull requests to contribute to the project. For major changes, please open an issue first to discuss what you would like to change.