Last week I took a look at Cloudinary GenAI transformations to demonstrate quickly creating different versions of media, including multiple sizes and text copy. While taking a look at other parts of the Cloudinary docs I discovered that they had not one, but four different ways to enhance images. These include:
- Generative restore
- Upscaling (reminds me of CSI)
- Enhance
- Improve
Looking at this list, it may be difficult to differentiate one from the other, luckily they provide a nice tabular list with specifics and use cases. Today I want to shine a light on two of them - enhance and improve.
From the docs, enhance is described as: "Enhances the overall appeal of images without altering content using AI."
Improve is described as: "Automatically improves images by adjusting colors, contrast, and lighting."
Both of these feel very similar to the work I've done in the past with the Lightroom API (more on that at the end) where you can provide an image, and just ask the API to "make it better".
It just so turns out I've got quite a few 'not so hot' photos which means I've got some great things to test against. And even better, I can test all of this without writing any code. Let's take a look.
Improve
I began with the improve enhancement first. This enhancement comes with two different options:
- mode - which is either outdoor or indoor. Specifying this lets help the API tailor it's work. This defaults to outdoor.
- blend - tells the API how much of the original versus the improved image to return. This defaults to 100.
If we were writing code, the Python code is pretty simple:
CloudinaryImage("horses.jpg").image(effect="improve:50")
But it's even easier to just quickly modify the URL.
So, consider this first image:
The URL for this is: https://static.raymondcamden.com/images/2025/01/totone/img2.jpg. I'm going to load this via Cloudinary using the fetch
command:
And then add the e_improve
transformation:
That definitely looks better. Here's another before and after - and again, ignoring the fetch
aspect, the only change is literally e_enhance
:
And after...
And finally, an indoor picture of one of my cats:
First, here's the transformation without specifying a mode:
To specify the mode, I switch from e_improve
to e_improve:indoor
:
Honestly I can't tell a difference, but both are better than the earlier image with more detail being visible in the cat's face.
Enhance
To test enhance, I had to upload my images to Cloudinary first, as fetched images aren't allowed with the feature. This transformation doesn't take any arguments so you simply add e_enhance
to the URL and that's it. I'll do before and after shots again so it's easier to compare.
Original:
Enhanced:
The effect is somewhat different than before. Now for the next two.
Original:
Enhanced:
And the final set:
Original:
Enhanced:
I think I prefer how improve works over enhance, but I could see either being an option. Where would I use this in a real world application? I think this could be real useful in cases where user's upload images to a web page/app. You could offer to save the 'enhanced/improved' version of their image as part of the process.
One More Quick Thing...
Before I leave, how about a kick butt web component for image comparisons? This Image Compare web component is as simple as:
<image-compare label-text="Screen Reader Label Text">
<img slot="image-1" alt="Alt Text" src="path/to/image.jpg"/>
<img slot="image-2" alt="Alt text" src="path/to/image.jpg"/>
</image-compare>
Here's an example of this in action