> ## Documentation Index
> Fetch the complete documentation index at: https://docs.img-processing.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Modulate Image

> Adjusts the brightness, saturation, and hue of an image.

### Description

This endpoint allows you to adjust the brightness, saturation, and hue of an image.

[Brightness](https://en.wikipedia.org/wiki/Brightness) is one of the three properties of color, along with hue and saturation. It refers to the amount of light in an image, with a high brightness making the image lighter and a low brightness making the image darker.

On the other hand, [saturation](https://en.wikipedia.org/wiki/Colorfulness) refers to the intensity of the colors in an image. A high saturation value will make the colors more vivid, while a low saturation value will make the colors more muted.

[Contrast](https://en.wikipedia.org/wiki/Contrast_\(vision\)) is the difference in brightness between the lightest and darkest parts of an image. A high contrast image will have a wide range of brightness values, while a low contrast image will have a narrow range of brightness values.

Finally, [exposure](https://en.wikipedia.org/wiki/Exposure_\(photography\)) refers to the amount of light that reaches the camera sensor when taking a photo. A high exposure value will make the image brighter, while a low exposure value will make the image darker.

***


## OpenAPI

````yaml openapi.json post /v1/images/{image_id}/modulate
openapi: 3.1.0
info:
  title: IMG Processing API
  description: >
    This powerful and flexible API provides a wide range of

    image manipulation and analysis capabilities, allowing developers to
    integrate advanced image processing

    features into their applications with ease.
  version: 1.0.0
servers:
  - url: https://api.img-processing.com
    description: IMG Processing API Server
security:
  - ApiKeyAuth: []
paths:
  /v1/images/{image_id}/modulate:
    post:
      tags:
        - Edition Endpoints
      summary: Modulate Image
      description: >-
        This endpoint allows you to adjust the brightness, saturation, and hue
        of an image.


        Brightness is one of the three properties of color, along with hue and
        saturation. It refers to the amount of light in an image, with a high
        brightness making the image lighter and a low brightness making the
        image darker.


        Contrast is the difference in brightness between the lightest and
        darkest parts of an image. A high contrast image will have a wide range
        of brightness values, while a low contrast image will have a narrow
        range of brightness values.


        Finally, exposure refers to the amount of light that reaches the camera
        sensor when taking a photo. A high exposure value will make the image
        brighter, while a low exposure value will make the image darker.
      operationId: modulate
      parameters:
        - in: path
          name: image_id
          schema:
            type: string
            description: >-
              The unique identifier of the image. This identifier is used to
              reference the image in subsequent requests.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                brightness:
                  type: number
                  minimum: -100
                  maximum: 100
                  description: >-
                    The brightness level to apply to the image. The difference
                    between the brightness and lightness parameters is that
                    brightness multiplies the color values, while lightness adds
                    a constant value to the color values. Value should be
                    between -100 and 100, where 0 is no change.
                saturation:
                  type: number
                  minimum: -100
                  maximum: 100
                  description: The saturation multiplier to apply to the image.
                exposure:
                  type: number
                  minimum: -100
                  maximum: 100
                  description: The exposure multiplier to apply to the image.
                contrast:
                  type: number
                  minimum: -100
                  maximum: 100
                name:
                  type: string
                  minLength: 1
                  maxLength: 30
                  description: >-
                    The name of the modulation. This is used to identify the
                    modulation in the dashboard.
              examples:
                - brightness: 2
                  name: bright-image
      responses:
        '201':
          description: The API will return the created Image object in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageObject'
        '401':
          description: >-
            Error object for unauthorized access. Probably due to missing or
            invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: >-
            Error object for forbidden access. Probably due to insufficient
            permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Error object for not found resources.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '422':
          description: Error object for validation errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: Error object for rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        5XX:
          description: Error object for internal server errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
components:
  schemas:
    ImageObject:
      type: object
      properties:
        id:
          type: string
          description: >-
            The unique identifier of the image. This identifier is used to
            reference the image in subsequent requests.
        name:
          type: string
          description: >-
            The name of the image. This name is provided when uploading the
            image and is the way the image is identified in your account. It is
            not unique, in fact, each transformation you make to an image will
            create a new image with the same name.
        url:
          type:
            - string
            - 'null'
          description: >-
            The public URL of the image. By default, this URL is not available
            and will be `null`. You can make the image public by using the
            publish endpoint. Once the image is public, the URL will be updated
            with the public UR.
        width:
          type: number
          description: The width of the image in pixels.
        height:
          type: number
          description: The height of the image in pixels.
        format:
          type: string
          enum:
            - png
            - jpeg
            - webp
          description: >-
            The format of the image. The format can be one of the following:
            `jpeg`, `png`, `webp`
        size:
          type: number
          description: >-
            The estimated size of the image in bytes. The size is an estimate
            and may not be exact since images can be compressed or optimized
            depending on the format and quality settings used during processing.
        created_at:
          type: string
          format: date-time
          description: >-
            The date and time when the image was created. The date and time are
            in ISO 8601 format.
      required:
        - id
        - name
        - width
        - height
        - format
        - size
        - created_at
      title: Image Object
      description: >-
        The Image object represents an image processed using the IMG Processing
        API. The object contains information about the image, such as its URL,
        size, and format. The Image object is returned in the response body of
        all image processing requests.
      examples:
        - id: image_etm0g3x5iap4cld1qcfsjvo2
          name: Processed Image
          url: >-
            https://storage.img-processing.com/images/image_etm0g3x5iap4cld1qcfsjvo2
          width: 460
          height: 460
          format: jpeg
          size: 282000
          created_at: '2021-09-01T12:00:00.000Z'
    UnauthorizedError:
      type: object
      properties:
        type:
          type: string
          description: The type of error
        error:
          type: string
          description: The title of the error
        status:
          type: number
          const: 401
          description: The status of the error
        message:
          type: string
          description: The error message
      required:
        - type
        - error
        - status
        - message
      title: Unauthorized Error
      description: >-
        Error object for unauthorized access. Probably due to missing or invalid
        API key
      examples:
        - type: https://docs.img-processing.com/errors/unauthorized
          error: Unauthorized
          status: 401
          message: API key is required.
    ForbiddenError:
      type: object
      properties:
        type:
          type: string
          description: The type of error
        error:
          type: string
          description: The title of the error
        status:
          type: number
          const: 403
          description: The status of the error
        message:
          type: string
          description: The error message
      required:
        - type
        - error
        - status
        - message
      title: Forbidden Error
      description: >-
        Error object for forbidden access. Probably due to insufficient
        permissions.
      examples:
        - type: https://docs.img-processing.com/errors/forbidden
          error: Forbidden
          status: 403
          message: You are not allowed to access this image.
    NotFoundError:
      type: object
      properties:
        type:
          type: string
          description: The type of error
        error:
          type: string
          description: The title of the error
        status:
          type: number
          const: 404
          description: The status of the error
        message:
          type: string
          description: The error message
      required:
        - type
        - error
        - status
        - message
      title: Not Found Error
      description: Error object for not found resources.
      examples:
        - type: https://docs.img-processing.com/errors/not-found
          error: Not Found
          status: 404
          message: Image with id {imageId} not found.
    ValidationError:
      type: object
      properties:
        type:
          type: string
          description: The type of error
        error:
          type: string
          description: The title of the error
        status:
          type: number
          const: 422
          description: The status of the error
        errors:
          type: array
          items:
            type: string
          description: The validation errors
      required:
        - type
        - error
        - status
        - errors
      title: Validation Error
      description: Error object for validation errors
      examples:
        - type: https://docs.img-processing.com/errors/validation-error
          error: Validation Error
          status: 422
          errors:
            - '{field or param} {error message}'
    RateLimitError:
      type: object
      properties:
        type:
          type: string
          description: The type of error
        error:
          type: string
          description: The title of the error
        status:
          type: number
          const: 429
          description: The status of the error
        message:
          type: string
          description: The error message
      required:
        - type
        - error
        - status
        - message
      title: Rate Limit Error
      description: Error object for rate limit exceeded.
      examples:
        - type: https://docs.img-processing.com/errors/too-many-requests
          error: Too Many Requests
          status: 429
          message: Rate limit exceeded. Try again later.
    ServerError:
      type: object
      properties:
        type:
          type: string
          description: The type of error
        error:
          type: string
          description: The title of the error
        status:
          type: number
          description: The status of the error
        message:
          type: string
          description: The error message
      required:
        - type
        - error
        - status
        - message
      title: Server Error
      description: Error object for internal server errors.
      examples:
        - type: https://docs.img-processing.com/errors/internal-error
          error: Internal Error
          status: 500
          message: >-
            An unexpected error occurred. Please try again later. If the problem
            persists, contact support.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````