Docs/Image Utils/GET /v1/grayscale

GET /v1/grayscaleConvert image to grayscale

Image Utils lf-image-utils

Shows what a picture looks like in black and white. Analyzes an image and returns grayscale sample data using luminosity, average, or lightness methods.

Query Parameters

ParameterTypeRequiredDescription
datastringYesBase64 image data or URL
methodstringNoConversion method

Response Schema

success (boolean): Operation success
source (string): Source type
method (string): Method used
samples (integer): Pixels sampled
stats (object): Grayscale statistics

cURL Example

curl 'https://lf-image-utils.laminarforge.dev/v1/grayscale?data=<base64_data>' -H 'Authorization: Bearer lf_YourApiKey'

Python Example

import requests
url = 'https://lf-image-utils.laminarforge.dev/v1/grayscale'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'data': '<base64_data>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())