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

  1. Upload an image or provide a URL link to the image.
  2. Select the conversion option as either "Grayscale" or "Black & White".
  3. Click on the "Convert" button to see the result.

Input Values

  1. Upload Image - Select an image file from your device.
  2. Image URL - Provide a link to the image.
  3. Option - Select either "Grayscale" or "Black & White" as the conversion type.

Output Values

  1. Converted Image - The resulting image in the chosen conversion type.
  2. 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():

  1. Converting an image to grayscale:
image_gray(upload_image=example_image.jpg, option='gray')
  1. 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.






Calculator: image_gray, Created by: super, V#0: , Variant owner: , Link