# Grayscale Image Online

Drop your image(s) here

## How to use this tool to Grayscale Image 🤔

- Click 👆 on the button and choose input image files, or you may drag and drop the image files to the Drop area. You may choose one image 🌁 or multiple images 🌃 🌄 🎇. The chosen images are displayed with size information in the input section.
- You may change the conversion parameters like quality 🎛, background color, etc., using the sliders, or color input buttons.
- Now you can click on the
**Grayscale Image**operation. This all happens in a lightening speed ⚡. button. This is where the ⛄ magic happens. Your images are sent ➚ to the server for the specified - Once the input images are transformed ✅, they appear in the download section.
- You may click 👆 on the big button to download ↓ all your transformed images.
- There is also a link 🔗 which you can and share it using which you can download the resulting images.

**Disclaimer:**Please be aware that due to limited server storage, converted images will be automatically purged over time for optimal server performance.

## Image Grayscale Effect

The grayscale effect transforms a color image into shades of gray. This effect removes color information while preserving the intensity of light, creating a classic and timeless appearance.

The conversion process involves calculating the luminance of each pixel and setting the red, green, and blue components to this luminance value.

### Grayscale Conversion Formula

The luminance (gray level) of a pixel is calculated using a weighted sum of its red, green, and blue components. The formula for calculating the luminance \( L \) is:

\[ L = 0.299 \cdot R + 0.587 \cdot G + 0.114 \cdot B \]

where:

- \( R \) is the red component of the pixel.
- \( G \) is the green component of the pixel.
- \( B \) is the blue component of the pixel.

The new color components \( R', G', B' \) are then set to the luminance value \( L \).

### Example Calculation

Consider a pixel with original color components \( (R, G, B) = (100, 150, 200) \).

The luminance \( L \) is calculated as:

\[ L = 0.299 \cdot 100 + 0.587 \cdot 150 + 0.114 \cdot 200 = 29.9 + 88.05 + 22.8 = 140.75 \approx 141 \]

So, the new color components of the pixel are \( (R', G', B') = (141, 141, 141) \).

### Applying the Grayscale Effect to the Image

The grayscale effect is applied to the entire image by iterating over each pixel, computing the luminance using the grayscale conversion formula, and setting the pixel's red, green, and blue components to this luminance value.

Converting an image to grayscale simplifies its color scheme, highlighting contrasts and textures. The process involves calculating the luminance of each pixel and updating the color components to create a grayscale image.