Cleaning Up a Bad Scan Before You Run a Style Transfer

Nov 18, 2026

When a style transfer comes out muddy, blotchy, or full of weird speckles, the instinct is to blame the model or start fiddling with prompts. In our experience maybe three out of four disappointing results are caused by the source file, not the conversion step.

Scans of drawings, prints, and old photos are almost always worse than they look on a phone screen. Fine paper texture reads as noise, uneven lighting reads as haze, and the auto-levels in your scanner app have already crushed detail you can never get back. A short cleanup pass at imagetoimage.cn territory — before you convert — fixes most of it.

Step 1: look at the histogram, not the image

Open the file in any editor with a levels tool. A good scan should have data spread across the range with a little empty space at both ends. Two problems show up constantly:

  • Clipped blacks — the graph slams into the left wall. Your scanner decided the darkest pencil stroke should be pure black and threw away everything below it. You cannot recover this, but you should know it is there before you expect fine shading.
  • Haze — the whole graph is squeezed into the middle third. This is a low-contrast scan, usually from a flatbed with a lid that did not sit tight. Easy to fix.

For haze, drag the black point up to where the data actually starts and the white point down to where it ends. That single move fixes a surprising amount of "washed out" complaints.

Step 2: neutralise the colour cast

Paper is never actually white. Off-white paper plus a warm room light gives you a scan with a yellow or cream cast, and the conversion will faithfully carry that cast into the output. If you asked for a cool blue-green style and got something olive, this is why.

Use a white-balance eyedropper on a blank patch of paper. If your editor has no eyedropper, a slight nudge of the blue channel up and the red channel down will usually land close enough.

Step 3: deal with paper texture

Cheap drawing paper and any kind of cartridge paper will show its tooth in the scan. At full size it is invisible; after conversion it becomes a uniform grain that fights hand-drawn line work.

Do not reach for a heavy blur — that eats the lines too. Either a light surface blur (2-3 pixels at 300 DPI) or a frequency-separation approach where you only smooth the low-frequency layer. Test on a small crop first, then apply the same setting to the whole file.

Step 4: fix rotation and crop for real

A one-degree tilt is invisible to you and very visible to an algorithm drawing straight edges. Use a ruler or straight-edge tool to align to an actual line in the artwork. Then crop generously — leave a margin. Tight crops make it harder to judge the edges of the frame during styling, and you can always crop after.

Step 5: decide about dust and specks manually

Automated dust removal is aggressive. It will happily delete highlights in an illustration that happen to be small. For a handful of specks, fix them by hand. For a genuinely filthy scan of a print, spot-heal in a copy first and compare — never batch it without checking.

Step 6: save a clean master, then work in copies

This is the step people skip and then regret. Save your cleaned file as a master with no styling applied, in a lossless format. Every style pass, every experiment, starts from that master. Files that have been through four JPEG re-saves before styling look soft no matter what you do downstream, because each save threw away different detail.

While you are saving, check the resolution. If you plan to output at 20cm wide, you want roughly 2400 pixels across the master. Upscaling later means inventing detail the conversion will then style, which is how you get that smooth, plasticky look.

What this buys you

A clean master scan with corrected levels, neutral paper colour, managed texture, and a lossless copy typically turns a mediocre conversion into a good one with zero change to your settings. It also makes batch work predictable, because all the inputs start from the same baseline.

If you want to see the difference for yourself, take one messy scan and run it twice — once raw, once after this routine. The gap is usually obvious within seconds. And if you start with clean files at imagetoimage.cn, you will spend a lot less time wondering why the results look flat.

Admin