This script is designed to adjust the color temperature of JPEG images, simulating warmer or cooler tones. The primary purpose is to provide a tool for modifying the color tones of images while preserving overall image quality.
-
Temperature Adjustment: The script accepts a temperature adjustment value (positive for warmer, negative for cooler) and applies it to the input image.
-
JPEG Format: The script specifically handles JPEG image files for both input and output.
-
Input Validation: Input parameters, including file paths and temperature adjustment values, are validated to ensure the script operates correctly.
-
Node.js: Ensure that Node.js is installed on your system. You can download it from Node.js Downloads.
-
Dependencies: Install the necessary dependencies using the following command:
npm install sharp
Run the script from the command line using the following syntax:
npm start -- input_image.jpg output_image.jpg temperature_adjustment_value
input_image.jpg
: Path to the input JPEG image.output_image.jpg
: Path to save the adjusted JPEG image.temperature_adjustment_value
: Numeric value for temperature adjustment (positive for warmer, negative for cooler).
Adjust the temperature of an image to make it warmer:
npm start -- input_image.jpg output_image.jpg 10
Adjust the temperature of an image to make it cooler:
npm start -- input_image.jpg output_image.jpg -10
If you'd like to contribute to this project, please fork the repository, create a new branch, and submit a pull request. Feel free to open issues for bug reports or feature requests.
This project is licensed under the MIT License.
Image by stockking on Freepik