# Dominant Color Quality

The `dominantColorQuality` function allows you to adjust the quality settings for calculating the dominant color of an image or video. The quality settings range from 1 to 10, with 1 being the highest quality and 10 being the default. Increasing the quality setting will result in more accurate color extraction, but may also consume more memory and processing power. If the quality settings are set too high relative to the size of the image, it may exceed the memory limit set in the PHP configuration, resulting in slow computation.

```php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Mostafaznv\Larupload\Storage\Attachment;
use Mostafaznv\Larupload\Traits\Larupload;

class Media extends Model
{
    use Larupload;

    public function attachments(): array
    {
        return [
            Attachment::make('file')->dominantColorQuality(6)
        ];
    }
}
```


---

# 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://mostafaznv.gitbook.io/larupload/advanced-usage/attachment/dominant-color-quality.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.
