# Levels Filter

## Description

Apply a Levels filter to an Image

{% tabs %}
{% tab title="Preview" %}
![](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FiSEdFUdtD0pNVM75ZHAU%2FComponent-FilterLevels.png?alt=media\&token=ad580eba-4acc-4951-8f76-0b9c10c467df)
{% endtab %}

{% tab title="Location" %}
**Name** | Levels Filter

**Nickname** | Levels&#x20;

**Tab** | Bitmap

**Panel** | Filter

**Division** | 2
{% endtab %}

{% tab title="Inputs" %}
**I** | **Image** (*B+ Image, Bitmap*) | A Bitmap Plus Image or Bitmap

<mark style="color:blue;">**M**</mark> <mark style="color:blue;"></mark><mark style="color:blue;">|</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**Mode**</mark> <mark style="color:blue;"></mark><mark style="color:blue;">(</mark>*<mark style="color:blue;">Integer</mark>*<mark style="color:blue;">) | Select filter mode</mark>

<mark style="color:orange;">**V0**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">|</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**Parameter**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">(</mark>*<mark style="color:orange;">Interval</mark>*<mark style="color:orange;">) |</mark> <mark style="color:orange;"></mark>*<mark style="color:orange;">This variable's use changes depending on the mode</mark>*

<mark style="color:orange;">**V1**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">|</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**Parameter**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">(</mark>*<mark style="color:orange;">Interval</mark>*<mark style="color:orange;">) |</mark> <mark style="color:orange;"></mark>*<mark style="color:orange;">This variable's use changes depending on the mode</mark>*

<mark style="color:orange;">**V2**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">|</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**Parameter**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">(</mark>*<mark style="color:orange;">Interval</mark>*<mark style="color:orange;">) |</mark> <mark style="color:orange;"></mark>*<mark style="color:orange;">This variable's use changes depending on the mode</mark>*

<mark style="color:orange;">**V3**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">|</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**Parameter**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">(</mark>*<mark style="color:orange;">Interval</mark>*<mark style="color:orange;">) |</mark> <mark style="color:orange;"></mark>*<mark style="color:orange;">This variable's use changes depending on the mode</mark>*

<mark style="color:orange;">**V4**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">|</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**Parameter**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">(</mark>*<mark style="color:orange;">Interval</mark>*<mark style="color:orange;">) |</mark> <mark style="color:orange;"></mark>*<mark style="color:orange;">This variable's use changes depending on the mode</mark>*

<mark style="color:orange;">**V5**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">|</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**Parameter**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">(</mark>*<mark style="color:orange;">Interval</mark>*<mark style="color:orange;">) |</mark> <mark style="color:orange;"></mark>*<mark style="color:orange;">This variable's use changes depending on the mode</mark>*
{% endtab %}

{% tab title="Ouputs" %}
**I** | **Image** (*B+ Image*) | A Bitmap Plus Image
{% endtab %}

{% tab title="Mode" %}
![](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FeV1ulrSGqAXPXGlo6uDD%2Fimage.png?alt=media\&token=fb42f272-523b-4276-8531-df4f25a0a55c)

**Save Image** | Opens a file save dialog to save a raster file of the current image.

**Copy Image to Clipboard** | Copies the image to the clipboard (no alpha)
{% endtab %}
{% endtabs %}

### **Filter** Mode

<details>

<summary><strong>Filter</strong> Mode Enumerable</summary>

* HSL = 0
  * *V0 =* **Si** | **Saturation In** | Unitized Domain (0,1)
  * *V1 =* **So** | **Saturation Out** | Unitized Domain (0,1)
  * *V2 =* **Li** | **Luminance In** | Unitized Domain (0,1)
  * *V3 =* **Lo** | **Luminance Out** | Unitized Domain (0,1)
* RGB = 1
  * *V0 =* **Ri** | **Red In** | Unitized Domain (0,1)
  * *V1 =* **Ro** | **Red Out** | Unitized Domain (0,1)
  * *V2 =* **Gi** | **Green In** | Unitized Domain (0,1)
  * *V3 =* **Go** | **Green Out** | Unitized Domain (0,1)
  * *V4 =* **Bi** | **Blue In** | Unitized Domain (0,1)
  * *V5 =* **Bo** | **Blue Out** | Unitized Domain (0,1)
* YCbCr = 2
  * *V0 =* **Ri** | **Red In** | Unitized Domain (0,1)
  * *V1 =* **Ro** | **Red Out** | Unitized Domain (0,1)
  * *V2 =* **Yi** | **Luma In** | Unitized Domain (0,1)
  * *V3 =* **Yo** | **Luma Out** | Unitized Domain (0,1)
  * *V4 =* **Bi** | **Blue In** | Unitized Domain (0,1)
  * *V5 =* **Bo** | **Blue Out** | Unitized Domain (0,1)

</details>

## Usage

### Levels Mode Samples

![RGB - Blue Out = 0.0](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FMENGc6kTxIREWc7s7h8A%2FRGB_Bo_0.jpg?alt=media\&token=f23bc370-0ccf-47f7-81cb-0e401a0f7047) ![RGB - Green Out = 0.0](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2Fe2b9hjA2H2b8r9dtvvmv%2FRGB_Go_0.jpg?alt=media\&token=24787745-b360-4273-a138-be3653003856) ![RGB - Red Out = 0.0](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FxZM3j8U1fwaJTK0ms1Qk%2FRGB_Ro_0.jpg?alt=media\&token=53a4ee95-e23f-458b-b809-5e4971717953)

![YCbCr - Blue Out = 0.0](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FGuDjOYQRacUvyGHax7wi%2FYCbCr_Bo_0.jpg?alt=media\&token=4f3d49de-88b5-4ae9-9c55-0efcdb5f515e) ![YCbCr - Red Out = 0.0](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2Fqhxv2zguuc2ooWs1bGis%2FYCbCr_Ro_0.jpg?alt=media\&token=7cc33310-010b-499c-8fff-17d562acbe7c) ![YCbCr - Luma Out = 0.0](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FUQXrS1Lrwldy2fd0SNYs%2FYCbCr_Yo_0.jpg?alt=media\&token=4e97e176-81f1-4a46-b0d7-67fb74c9993f)

![HSL - Saturation Out = 0.25](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FIhPIXEyDCxuD2i2vZ1oS%2FHSL_Lo_25.jpg?alt=media\&token=d8ebff27-03ec-4406-9223-222f2f02b022) ![HSL - Saturation Out = 0.5](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FxM0wXOp134b7Ky6yeGQ3%2FHSL_Lo_50.jpg?alt=media\&token=ee792b49-c295-477c-a57f-88e6843e2e04) ![HSL - Saturation Out = 0.75](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FG4r9OkLT9d1PjSSjA9Il%2FHSL_Lo_75.jpg?alt=media\&token=b169ab65-f45f-41d6-95ef-670816973275)

![HSL - Luminance Out = 0.25](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2FXMkyc0Vk46yZndkl9Gvh%2FHSL_So_25.jpg?alt=media\&token=796081a4-fb7f-4641-abac-bc742f15de35) ![HSL - Luminance Out = 0.5](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2Fp1MtIOAjcSEkhEwODSwb%2FHSL_So_50.jpg?alt=media\&token=d62dff1d-5920-458e-b00a-b0712bc5791c) ![HSL - Luminance Out = 0.75](https://3118158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhT7C2oduVfvz0FwKt3nj%2Fuploads%2F5Q0MtGkjxKXFoWTHOWrn%2FHSL_So_75.jpg?alt=media\&token=bec9a909-963b-4680-b75f-efeacd08c043)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://interopxyz.gitbook.io/bitmap-plus/components/filter/levels-filter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
