- Adjust the brightness, contrast, and saturation
- Adjust the hue, exposure, blur, and opacity
- Finetune value changing event
Contact Support
Finetune in Angular Image Editor component
26 Mar 20258 minutes to read
Fine-tuning involves making precise adjustments to the settings of an image filter in order to achieve a specific desired effect. It provides control over the intensity and specific aspects of the filter’s impact on the image. For example, fine-tuning allows you to modify parameters like brightness, saturation, or other relevant properties to fine-tune the level or quality of the filter’s effect. This level of control enables you to achieve the exact look or outcome you want for your image.
Adjust the brightness, contrast, and saturation
The finetuneImage
method is designed to facilitate fine-tuning operations on an image. It accepts two parameters: the first parameter is ImageFinetuneOption
which determines the type of fine-tuning to be applied (brightness, contrast, and saturation), and the second parameter represents the fine-tuning value, indicating the degree or intensity of the adjustment. This method allows for convenient adjustment of brightness, contrast, and saturation by specifying the desired type and corresponding value.
The finetuneImage
method is used to perform brightness, contrast, and saturation fine-tuning by specifying this type as a first parameter and specifying the fine-tuning value as the second parameter of the method.
-
finetuneOption - Specifies the finetune options to be performed in the image.
-
value - Specifies the value for finetuning the image.
Here is an example of brightness, contrast, and saturation fine-tuning using the finetuneImage
method.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ImageEditorModule, ImageEditorComponent, ImageFinetuneOption } from '@syncfusion/ej2-angular-image-editor';
import { Browser, enableRipple } from '@syncfusion/ej2-base';
import { Component, ViewChild } from '@angular/core';
@Component({
imports: [
ImageEditorModule
],
standalone: true,
selector: 'app-root',
template: `<div class="e-section-control">
<!-- To render Image Editor. -->
<div id="wrapperDiv" style="width:550px;height:350px;">
<ejs-imageeditor #imageEditor (created)="created()" [toolbar]="toolbar" ></ejs-imageeditor>
</div>
<button class="e-btn e-primary" (click)="brightnessClick()">Brightness</button>
<button class="e-btn e-primary" (click)="contrastClick()">Contrast</button>
<button class="e-btn e-primary" (click)="saturationClick()">Saturation</button>
</div>`
})
export class AppComponent {
@ViewChild('imageEditor')
public imageEditorObj?: ImageEditorComponent;
public toolbar: string[] = [];
public created(): void {
if (Browser.isDevice) {
this.imageEditorObj?.open('./flower.png');
}
else {
this.imageEditorObj?.open('./bridge.png');
}
}
brightnessClick(): void {
this.imageEditorObj?.finetuneImage(ImageFinetuneOption.Brightness, 10);
}
contrastClick(): void {
this.imageEditorObj?.finetuneImage(ImageFinetuneOption.Contrast, 30);
}
saturationClick(): void {
this.imageEditorObj?.finetuneImage(ImageFinetuneOption.Saturation, 100);
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
Adjust the hue, exposure, blur, and opacity
The finetuneImage
method is designed to facilitate fine-tuning operations on an image. It accepts two parameters: the first parameter is ImageFinetuneOption
which determines the type of fine-tuning to be applied (hue, exposure, blur, and opacity), and the second parameter represents the fine-tuning value, indicating the degree or intensity of the adjustment. This method allows for convenient adjustment of hue, exposure, blur, and opacity by specifying the desired type and corresponding value.
-
finetuneOption - Specifies the finetune options to be performed in the image.
-
value - Specifies the value for finetuning the image.
Here is an example of hue, exposure, blur, and opacity fine-tuning using the finetuneImage
method.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ImageEditorModule, ImageEditorComponent, ImageFinetuneOption } from '@syncfusion/ej2-angular-image-editor';
import { Browser, enableRipple } from '@syncfusion/ej2-base';
import { Component, ViewChild } from '@angular/core';
@Component({
imports: [
ImageEditorModule
],
standalone: true,
selector: 'app-root',
template: `<div class="e-section-control">
<!-- To render Image Editor. -->
<div id="wrapperDiv" style="width:550px;height:350px;">
<ejs-imageeditor #imageEditor (created)="created()" [toolbar]="toolbar" ></ejs-imageeditor>
</div>
<button class="e-btn e-primary" (click)="hueClick()">Hue</button>
<button class="e-btn e-primary" (click)="exposureClick()">Exposure</button>
<button class="e-btn e-primary" (click)="blurClick()">Blur</button>
<button class="e-btn e-primary" (click)="opacityClick()">Opacity</button>
</div>`
})
export class AppComponent {
@ViewChild('imageEditor')
public imageEditorObj?: ImageEditorComponent;
public toolbar: string[] = [];
public created(): void {
if (Browser.isDevice) {
this.imageEditorObj?.open('./flower.png');
}
else {
this.imageEditorObj?.open('./bridge.png');
}
}
hueClick(): void {
this.imageEditorObj?.finetuneImage(ImageFinetuneOption.Hue, 10);
}
exposureClick(): void {
this.imageEditorObj?.finetuneImage(ImageFinetuneOption.Exposure, 10);
}
blurClick(): void {
this.imageEditorObj?.finetuneImage(ImageFinetuneOption.Blur, 10);
}
opacityClick(): void {
this.imageEditorObj?.finetuneImage(ImageFinetuneOption.Opacity, 70);
}
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
Finetune value changing event
The FinetuneValueChanging
event is triggered when performing fine-tuning on the image. This event is passed an object that contains information about the fine-tuning event, such as the type of fine-tuning and the value of fine-tuning performed.
The parameter available in the FinetuneEventArgs
event is,
-
FinetuneEventArgs.finetune - The type of fine-tuning as
ImageFinetuneOption
to be applied in the image editor. -
FinetuneEventArgs.value - The fine-tuning value to be applied in the image editor.
-
FinetuneEventArgs.cancel – Specifies a boolean value to cancel the fine-tuning action.