Convert Image to Grayscale or Black & White (image_gray)
Convert your image to grayscale or black & white effortlessly with this tool. Perfect for adjusting image tones.
Convert Image to Grayscale or Black & White
Purpose
The function allows you to convert an image to either grayscale or black & white.
Use Cases
- Converting a color image to a simpler grayscale version.
- Converting an image to black & white for a more dramatic effect.
How to Use
- Upload an image or provide a URL link to the image.
- Select the conversion option as either "Grayscale" or "Black & White".
- Click on the "Convert" button to see the result.
Input Values
- Upload Image - Select an image file from your device.
- Image URL - Provide a link to the image.
- Option - Select either "Grayscale" or "Black & White" as the conversion type.
Output Values
- Converted Image - The resulting image in the chosen conversion type.
- Original Image - The image that was uploaded or linked.
Any other Instruction
- Make sure to choose the appropriate conversion type based on your desired outcome.
- The converted image will be displayed for you to download or further process.
Steps of Calculation
- The function takes the uploaded or linked image and processes it based on the selected conversion option.
- For grayscale, it uses ImageOps.grayscale() method.
- For black & white, it applies a threshold and converts the image using a lambda function.
Technical Parameter names
upload_image, image_url, option
Return Values
Converted Image, Original Image
Example Expressions
You can use the following expressions to directly evaluate in a non-interactive manner using eva():
- Converting an image to grayscale:
image_gray(upload_image=example_image.jpg, option='gray')
- Converting an image to black & white:
image_gray(image_url='https://example.com/image.jpg', option='bw')
Click on Help icon to open the help page on a separate window.