Visual HTML WYSIWYG Editor Tips: Make Images Pop with Auto Enhancements
Posted on By Aaron Dumon | Last updated on | In Editor, General
Itโs no secret that most users want their uploaded photos to look good, presentable, and aesthetically pleasing. Thatโs why in most modern applications, especially social media platforms, users can enhance their images before uploading them. They usually do so with the help of an image editor or a WYSIWYG HTML editor with image enhancement features. And thatโs nice, but what if the application can do the enhancements for them so that they wonโt have to do anything but upload? In this tutorial, weโll show you how to automatically apply image enhancements using a Visual HTML WYSIWYG editor.
Key Takeaways
- Image enhancement is an important feature for most modern applications
- Implement automatic image enhancement quickly using Froala and Filestack
- Greatly improve image quality with Filestackโs 10 different types of enhancement
- Choose between multiple presets depending on your requirements
- Use just one type of image enhancement (e.g., always upscale images) or let the user choose a preset using buttons
What is Image Enhancement?
Image enhancement refers to a process that improves the visual quality of an image. It typically involves increasing an imageโs resolution, adjusting colors and shadows, and correcting parts of an image that donโt look too good. Users can usually choose which type of image enhancement they want by either adjusting the images themselves or using buttons that automatically enhance an image when clicked. Alternatively, developers can allow just one type or preset of image enhancement.
For example, letโs say we have a social media site where users share stories and photos of their travels or the outdoors. We can then configure our application to always use the โoutdoorโ preset instead of presenting users with different options every time. Similarly, if weโre building a platform where users can upload various types of images, we can simply let the users decide and then bind some buttons to different image enhancement presets. But how exactly do we implement this feature? In this tutorial, weโll use Filestack, a file upload and transformation tool that supports image enhancements through simple API calls. The best part about this is that Froala (as of v4.3.0) natively comes with Filestack, meaning you can enhance images straight from your WYSIWYG editor. Before we start coding, letโs first check out the different enhancement presets available to Filestack.
Types of Image Enhancement in Froala WYSIWYG Editor
Through Filestack, Froala now supports the following types or presets of image enhancement:
- Upscale: Increase image resolution
- Auto: Automatically choose the optimal set of improvements for an image
- Vivid: Increase color depth and brightness
- Beautify: Automatically correct blemishes and color of faces in portraits of people
- Beautify Plus: Applies stronger corrections but works similarly to beautify
- Fix Dark: Corrects extremely underexposed photos
- Fix Noise: Automatically detect and remove grains from photos while preserving details
- Fix Tint: Remove abnormal tints due to cameras picking up excess green, red, blue, or yellow
- Outdoor: Optimize landscape images by adding color vibrancy and bringing out details from shadowy areas
- Fireworks: Set off excess color from fireworks while correcting grain from the night sky
Before we get started, note that Filestackโs image enhancement is a premium feature that supports images that are not larger than 10 MB.
How to Enhance Images in Froala WYSIWYG Editor
Implementing image enhancement is simple with Froala and Filestack. Weโll need an HTML in which weโll place the editor element and a JS for initializing the editor and setting its options. First, letโs create our WYSIWYG editor.
Building the WYSIWYG Editor
Insert the following code in your HTML file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Image Enhancements Using Froala and Filestack</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css" />
</head>
<body>
<div class="container-fluid vh-100">
<div class="row h-100">
<div class="col-md-6 mx-auto my-auto">
<div id="froala-editor"></div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<script src="https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js"></script>
<script src="https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js"></script>
<script src="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
<script src="js/index.js"></script>
</body>
</html>
Here, we essentially just load the required stylesheets and scripts for Froala and Filestack and then initialize the div element, where weโll initialize Froala Editor. Afterwards, go to your JS file and add the following code:
new FroalaEditor('#froala-editor',{
filestackOptions: {
filestackAPI: 'YourFilestackAPIKey',
uploadToFilestackOnly: true,
pickerOptions: {
accept: ['image/*'],
fromSources: ['local_file_system']
}
},
toolbarButtons: {
'moreRich': {
'buttons': ['openFilePickerImageOnly', 'insertLink', 'insertTable', 'emoticons', 'specialCharacters', 'insertHR'],
'buttonsVisible': 3
},
'moreText': {
'buttons': ['bold', 'italic', 'underline', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'clearFormatting']
},
'moreParagraph': {
'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'selectAll', 'html', 'help'],
'align': 'right',
'buttonsVisible': 2
}
},
events: {
'filestack.uploadedToFilestack': function (response) {
const originalFileHandle = response.filesUploaded[0].handle;
const enhancedFileURL = `https://cdn.filestackcontent.com/enhance=preset:vivid/${originalFileHandle}`;
const editor = FroalaEditor.INSTANCES[0];
editor.image.insert(enhancedFileURL, true, { link: enhancedFileURL, alt: 'Enhanced Image' });
},
'filestack.uploadFailedToFilestack': function (response) {
console.log(response);
},
},
heightMin: 500,
heightMax: 1000
});
In our JS, we create a new FroalaEditor object in our div element. For our filestackOptions, we declare our API key (get your free Filestack API Key here), allow uploads only to Filestack, and accept all types of images from the local file system. Whatโs more important here is the โfilestack.uploadedToFilestackโ event, which is where we perform the automatic image enhancements. After getting the Filestack handle of the uploaded file, we call the Filestack API that corresponds to the enhancement preset that we want. In this code, weโre using the โvividโ one, but weโll replace this later on to test out some of the other presets, so take note of this line of code. Afterwards, we insert the enhanced image back into the editor. With this, weโre done with our implementation. Letโs now run the application and check some of the presets that Filestack offers.
Trying out Different Image Enhancement Presets within the Editor
- Auto: Letโs start by using the โautoโ preset. For this, weโll use the โenhance=preset:autoโ CDN from Filestack. When you run the application and upload an image, you should see the resulting screen (shown below). The image above is the original photo, while the image below is the enhanced version. Upon inspection, the enhanced image now looks even better than before with its more vibrant blue hues, better contrast, and overall livelier feeling.

- Fix Dark: enhance=preset:fix_dark
- Original image

-
- Enhanced version

- Fix Noise: enhance=preset:fix_noise
-
- Original image

-
- Enhanced version

- Outdoor: enhance=preset:outdoor
-
- Original image

-
- Enhanced version

- Fireworks: enhance=preset:fireworks
-
- Original image

-
- Enhanced version

Itโs clear from these examples that the images, although already good, now look even better after undergoing Filestackโs enhancements. And it didnโt even require a lot of time or coding. With Froala and Filestack, you can do the same to your usersโ image uploads, boosting user experience and content quality.
Conclusion
Image enhancement doesnโt have to be a manual or time-consuming process. By using a solid WYSIWYG editor that natively supports powerful image enhancement features, you can improve image quality seamlessly. Whether itโs upscaling resolution, fixing underexposed shots, or adding life to outdoor photos, image enhancement ensures that your usersโ content always looks its best. Using Froala and Filestack, we demonstrated how you can quickly implement image enhancement in your application. How you implement it (e.g., whether youโll automatically enhance photos right away or let users decide) is up to you. Either way, you should definitely experiment with Filestackโs enhancement presets and determine what you need. Your users deserve stunning visualsโwhy not make it happen with a few lines of code?
Aaron Dumon
Aaron Dumon is an expert technical writer focusing on JavaScript WYSIWYG HTML Editors.





No comment yet, add your voice below!