- Adjust the brightness, contrast, and saturation
- Adjust the hue, exposure, blur, and opacity
- Finetune value changing event
Contact Support
Finetune in the ASP.NET CORE Image Editor control
21 Feb 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.
Here is an example of brightness, contrast, and saturation fine-tuning using the finetuneImage
method.
@{
var imageTool = new string[] { };
}
<div class="col-lg-12 control-section e-img-editor-sample">
<ejs-imageeditor id="image-editor" created="created" toolbar="@imageTool"></ejs-imageeditor>
</div>
<ejs-button id="brightnessClick" onclick="brightnessClick()" cssClass="e-primary" content="Brightness"></ejs-button>
<ejs-button id="contrastClick" onclick="contrastClick()" cssClass="e-primary" content="Contrast"></ejs-button>
<ejs-button id="saturationClick" onclick="saturationClick()" cssClass="e-primary" content="Saturation"></ejs-button>
<script>
function created() {
var imageEditorObj = ej.base.getComponent(document.getElementById('image-editor'), 'image-editor');
if (ej.base.Browser.isDevice) {
imageEditorObj.open('https://ej2.syncfusion.com/demos/src/image-editor/images/flower.png');
} else {
imageEditorObj.open('https://ej2.syncfusion.com/demos/src/image-editor/images/bridge.png');
}
}
function brightnessClick() {
var imgObj = ej.base.getComponent(document.getElementById('image-editor'), 'image-editor');
imgObj.finetuneImage(ej.imageeditor.ImageFinetuneOption.Brightness, 10)
}
function contrastClick() {
var imgObj = ej.base.getComponent(document.getElementById('image-editor'), 'image-editor');
imgObj.finetuneImage(ej.imageeditor.ImageFinetuneOption.Contrast, 100);
}
function saturationClick() {
var imgObj = ej.base.getComponent(document.getElementById('image-editor'), 'image-editor');
imgObj.finetuneImage(ej.imageeditor.ImageFinetuneOption.Saturation, 100);
}
</script>
<style>
.image-editor {
margin: 0 auto;
}
.e-img-editor-sample {
height: 80vh;
width: 100%;
}
@@media only screen and (max-width: 700px) {
.e-img-editor-sample {
height: 75vh;
width: 100%;
}
}
.control-wrapper {
height: 100%;
}
</style>
public ActionResult Default()
{
return View();
}
Output be like the below.
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.
Here is an example of hue, exposure, blur, and opacity fine-tuning using the finetuneImage
method.
@{
var imageTool = new string[] { };
}
<div class="col-lg-12 control-section e-img-editor-sample">
<ejs-imageeditor id="image-editor" created="created" toolbar="@imageTool"></ejs-imageeditor>
</div>
<ejs-button id="blurClick" onclick="blurClick()" cssClass="e-primary" content="Blur"></ejs-button>
<ejs-button id="exposureClick" onclick="exposureClick()" cssClass="e-primary" content="Exposure"></ejs-button>
<ejs-button id="hueClick" onclick="hueClick()" cssClass="e-primary" content="Hue"></ejs-button>
<ejs-button id="opacityClick" onclick="opacityClick()" cssClass="e-primary" content="Opacity"></ejs-button>
<script>
function created() {
var imageEditorObj = ej.base.getComponent(document.getElementById('image-editor'), 'image-editor');
if (ej.base.Browser.isDevice) {
imageEditorObj.open('https://ej2.syncfusion.com/demos/src/image-editor/images/flower.png');
} else {
imageEditorObj.open('https://ej2.syncfusion.com/demos/src/image-editor/images/bridge.png');
}
}
function blurClick() {
var imgObj = ej.base.getComponent(document.getElementById('image-editor'), 'image-editor');
imgObj.finetuneImage(ej.imageeditor.ImageFinetuneOption.Blur, 10)
}
function exposureClick() {
var imgObj = ej.base.getComponent(document.getElementById('image-editor'), 'image-editor');
imgObj.finetuneImage(ej.imageeditor.ImageFinetuneOption.Exposure, 10);
}
function hueClick() {
var imgObj = ej.base.getComponent(document.getElementById('image-editor'), 'image-editor');
imgObj.finetuneImage(ej.imageeditor.ImageFinetuneOption.Hue, 10)
}
function opacityClick() {
var imgObj = ej.base.getComponent(document.getElementById('image-editor'), 'image-editor');
imgObj.finetuneImage(ej.imageeditor.ImageFinetuneOption.Opacity, 10);
}
</script>
<style>
.image-editor {
margin: 0 auto;
}
.e-img-editor-sample {
height: 80vh;
width: 100%;
}
@@media only screen and (max-width: 700px) {
.e-img-editor-sample {
height: 75vh;
width: 100%;
}
}
.control-wrapper {
height: 100%;
}
</style>
public ActionResult Default()
{
return View();
}
Output be like the below.
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.