How image enhancement works
What a photograph holds at its own pixels, how ESRGAN learned to enlarge from synthetic pairs, how diffusion transformers such as SeedVR work, and the three compared on real photographs.
A four-times enlargement has sixteen pixels for every pixel of the photograph. One of them can be taken from the photograph; the other fifteen have to come from somewhere. This guide is about where they come from.
The guide covers what a photograph holds at the scale of its own pixels, what plain interpolation does with it, how models like ESRGAN and its successor Real-ESRGAN learned to enlarge photos from synthetic training pairs, and how the newer diffusion transformers work, with SeedVR as the example. The last part compares a bicubic enlargement, Real-ESRGAN, SeedVR and CraterView.ai Enhance on the same four photographs.
What a photograph holds
A photograph is a sampled record of a scene, and each step between the scene and the file loses detail or adds errors:
- Optics. The lens and the atmosphere blur the image before it reaches the sensor.
- Sampling. The sensor records one value at each photosite, most often through a Bayer colour filter array (CFA). Detail that survives the optics but is finer than what the array can represent causes aliasing.
- Noise. Light arrives as individual packets of energy (photons), and the sensor electronics adds noise of its own. Both sources grow more visible in low light and at high ISO. A scanned negative or print adds film or print grain noise.
- Processing. Cameras demosaic (de-Bayer) the image and usually apply sharpening, which could smear fine texture and leave halos beside edges.
- Compression and resizing. JPEG and other lossy compression methods further discard fine detail in blocks, and often more of the colour than of the brightness. Each resize and each save on the way to a website or a messaging app repeats the loss.
A Bayer colour filter array, the arrangement most cameras use.

Four photographs scaled up four times to show individual pixels. Top left, JPEG blocks in a rock face above Lake Agnes, the photograph re-saved at JPEG quality 40 for this figure so that the blocks are plain (photograph by Garythai, CC BY-SA 4.0, via Wikimedia Commons). Top right, dark outlines left by sharpening around a hiker (photograph by Toomas Tartes on Unsplash). Bottom left, a full moon rising, blurred by the air (photograph by Astro Backyard). Bottom right, sensor noise in a plain surface at ISO 25600 (photograph by Dietmar Rabich, CC BY-SA 4.0, via Wikimedia Commons).
A photograph that needs enlarging usually has several of these at once, in amounts nobody recorded. The central challenge of image enhancement is recovering the true scene detail from a blurry, noisy and lossily encoded digital image.
Enlarging by interpolation
Nearest-neighbour, bilinear, bicubic and Lanczos interpolation compute each new pixel as a weighted average of the pixels near it. They differ in how many neighbours they weigh and how. None adds information: an interpolated enlargement holds no detail finer than the photograph’s own pixels, so it looks smooth, and it enlarges the photograph’s noise, blocks and halos along with everything else. Bicubic interpolation is a reference that research on image enhancement often measures itself against, and a bicubic enlargement is a fair picture of what the photograph holds.
Learning from pairs
A model that enlarges is trained on pairs: a sharp image, and a low-resolution (LR), worse copy of it. The model learns to produce the sharp image from the LR input. A sharper version of a real photograph usually does not exist, so nearly all training pairs are made by taking sharp images and degrading them. What a model can undo is therefore also usually bounded by the damage its training pairs contain.
Pairs made by reduction
The first learned models, SRCNN (2014), then SRGAN (2017) and ESRGAN (2018), were trained on pairs whose LR half was the sharp image reduced by bicubic interpolation. Such a copy is small but clean: no blur beyond the reduction, no noise and no compression. A model trained on it does very well on images reduced the same way and poorly on real photographs. Since the model never saw noise or JPEG blocks during training, it takes them for signs of scene detail and sharpens them.
Two-stage degradation used by Real-ESRGAN
Real-ESRGAN (2021) keeps ESRGAN’s network and changes how its training pairs are made. Each LR half is made by applying a chain of damage twice, with every setting drawn at random for every pair:
- Blur, with a Gaussian kernel, round or stretched and rotated, one of two variants with heavier or flatter tails, or now and then a sinc kernel.
- Resize, up or down by a random factor, by area averaging or by bilinear or bicubic interpolation.
- Noise, Gaussian or Poisson (the random photon count), in colour or the same in every channel.
- JPEG compression, at a quality between 30 and 95.
The second stage repeats the chain with its own draws, and its JPEG compression is the last step. Just before or just after it, the image is resized to a quarter of the original’s size and filtered with a sinc filter, which produces the ringing and overshoot beside edges that sharpening and some resizing leave. Applying the chain twice imitates a photograph that was processed and saved, then resized and saved again, which is how many photographs reach the web. BSRGAN, published the same year, makes its pairs from a similar set of degradations applied in random order.

The high-gain antenna on the Apollo 15 lunar rover, 1971, as training pairs see it. Top left, the sharp original. Top right, reduced to a quarter of the size by bicubic interpolation, the small half of a pair as ESRGAN was trained. Bottom, two quarter-size copies made by Real-ESRGAN’s two-stage degradation with different draws: a heavy one, blurred, with halos around the dish and blocks in the sky, and a light one. Photograph by NASA (AS15-85-11471).
Real-ESRGAN’s synthetic damage covers much of what real photographs suffer, but not all of it. It has no demosaicing errors, no camera-specific noise or sharpening, no motion blur, and no film grain or print damage. A model trained this way works well, but might still struggle with images from modern cameras that include image processing or with recovering detail from film and prints.
How the ESRGAN model works
The network
ESRGAN is a convolutional neural network, drawn below. Its first convolution turns each pixel of the small image into 64 numbers, or features. Twenty-three residual-in-residual dense blocks then refine those features at the small image’s size. Each block holds three dense blocks of five convolutions, in which each convolution reads the block’s input and the outputs of every convolution before it. Every dense block, and every residual-in-residual block around three of them, scales its output by 0.2 and adds it to its input, which keeps a network this deep trainable. One more convolution follows the last block, and its output is added to the first convolution’s features. Then two upsampling steps each double the size by repeating pixels and applying a convolution, and two last convolutions turn the features back into red, green and blue. The four-times network has about 16.7 million parameters.
ESRGAN’s generator, drawn after Figures 3 and 4 of its paper.
Every operation is a small convolution, so each pixel of the result is computed mostly from a neighbourhood of the input around it: for a pixel of the trail map compared below, half of the effect comes from within 11 pixels and 90% from within 34. Distant parts of the picture reach it only faintly.
The losses
Training adjusts the network to reduce three measures of how far its result is from the sharp image:
- A pixel loss, the average difference between the two images. On its own it produces blurred results. When many sharp images are consistent with one small copy, the result that minimizes the average difference is close to their average, and an average of plausible details is smooth.
- A perceptual loss, the difference between the two images’ features inside an image classification network (VGG-19). It rewards similar edges and textures rather than identical pixels.
- An adversarial loss. A second network, the discriminator, is trained to tell the generator’s results from real sharp images, and the generator is trained to fool it. This is what makes ESRGAN’s results sharp. It is the “GAN” in the name: a generative adversarial network. ESRGAN’s discriminator judges whether real images look more real than the generator’s results on average; Real-ESRGAN’s judges every pixel, and is built to stay stable on its harder pairs.
No result can be both closest to the sharp image on average and most like a real photograph. Blau and Michaeli (2018) showed that the two goals trade off against each other. The adversarial loss moves ESRGAN toward the second.
What it does well and where it fails
ESRGAN is small and fast. Real-ESRGAN enlarges a small photograph in seconds, even without a graphics processor, and its results are clean and sharp at edges. It learned to make sharp texture that looks right locally, but not what objects are. Foliage becomes flat patches of colour, fur becomes glossy strokes, skin becomes smooth and waxy, and letters become shapes like letters that spell nothing. Because it was trained to remove heavy damage, it also removes fine detail it cannot tell apart from that damage.
Newer generative models
Newer enhancement models differ from ESRGAN in network and in how they produce a result. Many recent models are diffusion transformers: vision transformers trained as diffusion models.
Attention
A vision transformer divides the image into small patches and turns each into a vector, a token. Layers of self-attention then compute each token’s next value from all the others, weighted by how relevant each is to it. A convolution reads a fixed neighbourhood while attention can relate any patch to any other in the image. The model can use a letter’s shape elsewhere on the same sign, one eye of a face for the other, or a pattern that repeats across the frame. The cost of attention grows with the square of the number of tokens, so large images are processed in tiles, or with attention limited to windows.
Removing noise
A diffusion model learns to remove noise. In training, a sharp image is mixed with random noise in a proportion drawn at random and the network learns to predict from the mixture the way back to the sharp image. To produce an image, it starts from pure noise and takes a series of steps, each removing part of the noise, until only an image is left. Because the starting noise is random, two runs can end at two different images. The model has not learned one answer for each input; it has learned the range of images that fit, and each run ends at one of them.
For enhancement, the network is also given the photograph, beside the noisy image, at every step. Training pairs are made as they are for ESRGAN, by degrading sharp images, and the network learns to remove noise toward the sharp image that matches the degraded one. The photograph fixes the structure of the result, and the steps supply fine detail consistent with it.
Working in a compressed space
Many steps over every pixel of a large image would be slow, so most models of this kind work in the latent space of an autoencoder. Its encoder, trained beforehand, compresses an image into a smaller grid of numbers that keeps what matters to how the image looks, and its decoder turns such a grid back into pixels. The steps run on the compressed grid, the photograph is compressed the same way, and the decoder draws the result. The transformer makes each small group of grid positions into one token.
Learning what photographs look like
Models of this kind are far larger than ESRGAN and are trained on far larger collections of images. Many begin as models trained to generate images from text descriptions, so they begin already knowing what photographs of many kinds of subject look like: how a face is built, how letters are formed, how fur grows. Training for enhancement teaches them to draw that knowledge onto the structure of a photograph.
SeedVR, an example
SeedVR restores videos and still images (Wang et al., 2025, from Nanyang Technological University and ByteDance). The model in its paper is a diffusion transformer of about 2.5 billion parameters, some 150 times the size of ESRGAN, and its network began as Stable Diffusion 3 Medium, a text-to-image model. The versions its authors later released have 3 and 7 billion.
Its autoencoder’s encoder turns each block of 8 by 8 pixels into 16 numbers. The photograph, resized to the result’s size, is encoded this way and joined to a grid of noise of the same size. The transformer makes each 2 by 2 group of those positions into a token, so one token stands for 16 by 16 pixels of a frame, and a linear layer turns each token into the vector its blocks work on. The 7B model has 36 transformer blocks, each also told the noise level. A last linear layer and the reverse of the patching give back a grid, which the decoder turns into the result. The authors’ inference script then gives the result the photograph’s broad colours with a wavelet colour fix, and the comparisons below include it.
Its attention works within windows, not across the whole frame. Attention between every pair of tokens in a large frame would cost too much, and a model trained that way at one resolution would work poorly at others. Each window covers 64 by 64 positions of the compressed grid, or 512 by 512 pixels. As in the Swin Transformer, alternate blocks shift the windows by half their size, so information passes from window to window across the frame. It can also be given a text description for additional context during reconstruction. Text encoders turn the description into tokens, and attention in each window reads them beside the window’s image tokens, with separate weights for each kind of token, as in the Stable Diffusion 3 network it began as. The authors’ inference script gives every photograph the same prepared description.
SeedVR2’s generator, drawn after Figure 2 of each paper, with the 7B model’s 36 blocks.
It was trained on about 10 million images and 5 million video clips, cropped from larger originals rather than reduced. Image pairs were made by degradations of the kind Real-ESRGAN uses.
Fewer steps
Each step is a pass through a network of billions of parameters, so the number of steps sets most of the cost. SeedVR2 (Wang et al., 2025) brings it down to one step, in two stages:
- Progressive distillation. A copy of the model learns to do in one step what the original does in two. The copy then serves as the original for the next round, and the rounds repeat, from 64 steps down to one.
- Adversarial post-training. As in ESRGAN, a discriminator learns to tell the model’s results from real sharp images and video, and the model learns to fool it, which moves its results toward looking real rather than toward the closest average. The discriminator is itself a diffusion transformer. A feature-matching loss takes the place of ESRGAN’s perceptual loss: it compares the discriminator’s own internal features for the result and for the sharp original, which avoids decoding every result to pixels during training.
The one-step model is more than four times faster than diffusion restoration methods that take 50 steps. The gain is not fiftyfold because the autoencoder then takes most of the time: more than 95% of it for a 100-frame 720p video, by the authors’ measure.
SeedVR2 also sizes its windows to the frame. With windows of a fixed size, results at resolutions well above those it was trained at showed seams between windows, so it gives each window about as many tokens as one of a 720p frame’s 3 × 3 windows had in training, shaped to the frame, and a larger frame gets more of them: the trail map’s result is cut into 5 × 5 windows of about 300 by 340 pixels. Its authors name its limits: it is not always robust to heavy damage or very large motion, and on lightly damaged input it can add too much and oversharpen.
What follows from it
The detail such a model draws follows the objects in the picture rather than only the texture nearby. Strands follow a lock of fur, letters are drawn as letters, and skin is drawn with pores and creases. Where the photograph holds enough of a word, the model often reads it correctly. Where it does not, the model draws a plausible word that may be wrong. A result is an informed estimate: every detail the photograph does not hold is the model’s best guess at it. These models also need far more computation than ESRGAN, and run on graphics processors.
CraterView.ai Enhance
At CraterView.ai we follow the field closely. We build on existing research and open source approaches like the Real-ESRGAN’s synthetic training data procedure and SeedVR-like image context.
Our central focus remains the recovery of the true scene detail from digital images. Three things help to achieve this while maintaining high image quality: good training data, computer vision models that give better context at inference time, and every part of the model grounded and well implemented.
Compared on four photographs
Each figure below shows:
- Bicubic, an interpolated enlargement. It adds no detail, so it shows what the photograph holds.
- Real-ESRGAN, its authors’ published four-times model with default inference arguments.
- SeedVR2-7B, the larger of its authors’ two published one-step models with default inference arguments.
- CraterView.ai Enhance,
cv-enhance-v3atscale: 4with its default settings, run through the API on 27 November 2026.
Text
Bicubic
Real-ESRGAN
SeedVR2-7B
CraterView.ai EnhanceThe legend of a trail map at Lynn Canyon Park. The words are only just legible in the bicubic enlargement. Real-ESRGAN draws crisp black strokes, shaped like letters, that spell nothing: it learned what the edges of letters look like but not what letters are. SeedVR2 draws clean type and gets the headings right, but not the small words: Appcoermate tanes foen the, Powell Trad, Sunpension Bridge, and the bridge’s 2 minutes become 3. Its letters are real letters, and the words are wrong. Enhance reads the legend correctly. The road names beside it are too small in the photograph to read, and Enhance gives them spellings the photograph cannot confirm, such as Demonry Road and Runth Road. A sharp word in a result is not evidence that the word was in the photograph.
A face
Bicubic
Real-ESRGAN
SeedVR2-7B
CraterView.ai EnhanceA surfer with an alaia, a wooden surfboard, from an old print. Real-ESRGAN sharpens the outlines and smooths the skin until it looks waxy. SeedVR2 draws a crisp ear and beard, and smooth, glossy skin with bright highlights. Enhance draws skin texture, creases at the eye and single hairs in the beard, and a few white specks like dust on a print. The face it draws is an informed estimate of the person, not a record of them. Photograph by Frank Davey, public domain, via Wikimedia Commons.
Fur
Bicubic
Real-ESRGAN
SeedVR2-7B
CraterView.ai EnhanceA dog’s face and coat. Real-ESRGAN turns the locks into glossy, smooth strokes like brushwork. SeedVR2 draws fine, crisp strands spread evenly over the whole coat, so the separate locks are less distinct. Enhance draws fine strands that follow the way each lock falls. Photograph by Megs Harrison on Unsplash.
Foliage and sharpening
Bicubic
Real-ESRGAN
SeedVR2-7B
CraterView.ai EnhanceThis photograph has dark outlines around the hair and the pack from sharpening, and the bicubic enlargement keeps them. Real-ESRGAN and Enhance remove them. SeedVR2 keeps them as broken dark lines and specks, and paints the hair smooth. Real-ESRGAN smooths the scrub into flat patches of colour, and SeedVR2 draws it softly with a few twigs; Enhance draws twigs and leaves, and the pack’s straps and seams. The twigs are drawn, not recovered: they are plausible for the scene, and they are not the ones that were there. Photograph by Toomas Tartes on Unsplash.
Summary
| Interpolation | ESRGAN and Real-ESRGAN | Diffusion transformers | |
|---|---|---|---|
| What fills the new pixels | Weighted averages of nearby pixels | Texture learned from training pairs, from a neighbourhood of the input | Detail learned from large image collections, from context across the picture |
| Detail it adds | None | Sharp edges and local texture | Detail that follows the objects in the picture |
| Typical failure | Soft; enlarges noise and blocks | Waxy skin, flat foliage, letters that spell nothing | Plausible detail that was not in the scene, including wrong words |
| Computation | Negligible | Seconds, even without a graphics processor | Needs a graphics processor |
Interpolation shows what the photograph holds and nothing more. A model shows its best estimate of what the scene looked like.
Further reading
- Dong, Loy, He and Tang, Learning a Deep Convolutional Network for Image Super-Resolution, ECCV 2014 (SRCNN).
- Ledig et al., Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network, CVPR 2017 (SRGAN).
- Blau and Michaeli, The Perception-Distortion Tradeoff, CVPR 2018.
- Wang et al., ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks, ECCV Workshops 2018, arXiv:1809.00219.
- Zhang, Liang, Van Gool and Timofte, Designing a Practical Degradation Model for Deep Blind Image Super-Resolution, ICCV 2021 (BSRGAN), arXiv:2103.14006.
- Wang, Xie, Dong and Shan, Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data, ICCV Workshops 2021, arXiv:2107.10833.
- Dosovitskiy et al., An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale, ICLR 2021, arXiv:2010.11929.
- Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows, ICCV 2021, arXiv:2103.14030.
- Ho, Jain and Abbeel, Denoising Diffusion Probabilistic Models, NeurIPS 2020, arXiv:2006.11239.
- Saharia et al., Image Super-Resolution via Iterative Refinement, 2021 (SR3), arXiv:2104.07636.
- Rombach et al., High-Resolution Image Synthesis with Latent Diffusion Models, CVPR 2022, arXiv:2112.10752.
- Peebles and Xie, Scalable Diffusion Models with Transformers, ICCV 2023, arXiv:2212.09748.
- Wang et al., SeedVR: Seeding Infinite Potential in Diffusion Transformer Towards Generic Video Restoration, 2025, arXiv:2501.01320.
- Wang et al., SeedVR2: One-Step Video Restoration via Diffusion Adversarial Post-Training, 2025, arXiv:2506.05301.
Try it on your own file
No sign-up and no card — a workspace opens in your browser the moment you arrive.
Open Web App