Make things · Beginner

Editing an Image

Draft, open for academic review

Layers, masks, curves and export: the craft behind a photo that still holds up at full size.

Your progress here is recorded once you pass the Design, before Any Software exam.

8 modules. 78 lessons.

What an image is made of

10 lessons · 1 h 31

You will be able toOpen an unfamiliar image file and state what it can and cannot survive (its bit depth, colour space, alpha, compression history and lens geometry) and predict from those facts which edits will band, fringe, clip or fail to print, before making any of them.

  1. 1.1The photo you were sent is too small, and nothing fixes thatStart9 min
  2. 1.2Three numbers per pixel, and why green counts most9 min
  3. 1.3Why the sky turns into stripes9 min
  4. 1.4Mid-grey is not half the light10 min
  5. 1.5Transparency is a number, and it carries a colour with it9 min
  6. 1.6Two thirds of the colour in your photo was calculated10 min
  7. 1.7Eight by eight, and what the encoder threw away9 min
  8. 1.8Some colours have no number9 min
  9. 1.9The monitor is a measuring instrument nobody calibrated8 min
  10. 1.10Straight lines that are not straight, and colour that is not there9 min
An illustrative case, built from documented patternsThe bank’s logo, the banner, and the file nobody keptA two-person print shop in Erode, three days before a co-operative bank’s sixtieth anniversary function.

The order

The branch manager wanted a vinyl banner three metres wide for the front of the building, with the bank’s crest, its name in English, and its name in Tamil underneath. He emailed the logo. It was a PNG, 900 pixels across, saved from the bank’s own website some years earlier by somebody who no longer worked there.

The shop’s owner did the arithmetic on the back of the order slip. Three metres is about 118 inches. Nine hundred pixels across 118 inches is under eight pixels per inch.

That number by itself does not condemn the job. Billboards are routinely output at ten to twenty pixels per inch and nobody standing on the road notices, because a photograph read from twenty metres has no detail at that scale anyway and degrades gently. The rule of thumb that says 300 is for something held in the hand.

But this was not a photograph. It was a crest with a fine rule around it, a serif wordmark, and Tamil letterforms whose vowel marks are small strokes sitting above and beside the consonants. Hard edges and small strokes are exactly what a low sample count destroys, and a guest standing two metres from the entrance would be reading it at arm’s length, not from a moving car.

Three routes, none of them free

Upscale it. Upscayl, free, twenty minutes, four times or eight times. On skin and brickwork it would have been remarkable. On letterforms it predicts plausible shapes from the low-resolution evidence, and plausible is not the same as correct. The result looks crisp, which is the dangerous part, because nothing in the file announces that the strokes have been invented.

Redraw it. The crest could be traced as vector in Inkscape in about four hours, and vector has no resolution at all, so three metres or thirty would be the same file. The Tamil wordmark was the problem: the original was set in a licensed font nobody in the shop had, so it would have to be traced letter by letter by eye. That is a full day, and a full day is the wedding-card job that was already on the bench.

Ask head office. One phone call and, if somebody answered, the original artwork. The bank’s marketing department is in Coimbatore and had not replied to an email about a rate card in two weeks. The function was on Friday and vinyl printing needed the file by Thursday morning.

The cost sat on every side. A day of a two-person shop’s capacity is a real loss. So is a banner with a slightly wrong crest, at a function the district collector was attending, produced by a shop whose name would be on the bottom edge.

What the owner actually decided

He ran all three at once, which is the decision worth noticing. He put his assistant on the Inkscape trace on Tuesday morning as insurance, sent the upscaled version to the large-format printer as a single A3 proof so he could look at it rather than argue about it, and telephoned Coimbatore three times until somebody found the artwork.

The A3 proof settled the argument on its own. At one metre the English wordmark looked acceptable. The Tamil vowel marks were visibly the wrong shape (one had acquired a curl it does not have) and the fine rule around the crest had gone slightly wavy where the model had smoothed it.

How it played out

Coimbatore sent an EPS on Wednesday afternoon, four hours after the assistant had finished the crest and started on the wordmark. The banner printed from the vector artwork and nobody at the function thought about it, which is the point. The shop kept the half-finished trace, and it has been used twice since for signage where head office was slower.

Two things changed permanently. The order slip now has a line on it that says vector artwork received: yes / no, filled in when the job is taken rather than when it is due, so the conversation happens on day one instead of the night before. And the shop keeps a folder of client logos in whatever the best available form is, backed up to a pen drive kept at the owner’s house, because the reason this job nearly failed is that the only copy in existence at the branch was a screenshot of a website.

Worth arguing about

  1. Billboards are printed at ten to twenty pixels per inch and nobody complains. Why was eight pixels per inch a problem on this banner?

    One answer

    Because viewing distance and content both matter, and this job had the wrong values for both. The billboard rule holds for photographs read from far away: a photograph has no hard edges, so missing detail reads as softness and softness is invisible at distance. A crest with a fine rule and a Tamil wordmark is made almost entirely of hard edges and small strokes, and it would be read by guests standing a couple of metres from the door. The ppi figure in a file is only a tag and changes nothing; what matters is pixels divided by the printed size, checked against how close the reader will stand.

  2. The upscaled version was not merely soft. What made it dangerous, and how did the proof expose that?

    One answer

    A model-based upscaler does not interpolate between the samples you have; it predicts a plausible high-resolution image from the low-resolution evidence. On photographic texture the plausible answer is usually close to the true one. On letterforms it is not: the model regenerates the strokes, and they come back crisp and subtly the wrong shapes, with no warning that anything was invented. Printing one A3 proof and looking at it at reading distance turned an argument about a setting into an observation: a Tamil vowel mark with a curl it does not have, and a wavy rule where the model had smoothed a straight line.

  3. The shop added one line to its order slip afterwards. Why is that worth more than any technique in this lesson?

    One answer

    Because it moves the limit to the start of the job, where it can still be acted on. Opening the file, noting the pixel dimensions and dividing by the printed size takes under a minute, and it tells you on the day the order is taken whether the job is possible. Saying so on day one is a professional conversation; discovering it on the night before the deadline is an emergency in which every remaining option costs somebody something. The second change (keeping client artwork in the best form available) attacks the actual cause, which was that the only copy anyone could reach was a screenshot of a web page.

Test yourself6 questions on this modulePractice. Nothing is recorded and no score is kept.
  1. 1

    A client sends a 600-pixel-wide product photograph for a listing that needs 2,400 pixels. Enlarging it in any editor gives a soft result. What is the mechanism?

  2. 2

    You want to build a mask from a single colour channel and need the one carrying the least noise. Why is green usually it?

  3. 3

    You open an 8-bit JPEG of a smooth sky, convert the document to 16 bits per channel, and then apply a strong Curves stretch. What has the conversion achieved?

  4. 4

    A photograph of a starfield, downscaled to a quarter of its width, comes back noticeably darker than the original. What has gone wrong?

  5. 5

    Red type on a white background, saved as JPEG, has a soft dirty fringe. Raising the quality from 70 to 95 barely changes it. Why not?

  6. 6

    A raw developer recovers about a stop of a slightly blown sky that the camera’s own warning said was gone. Which fact makes that possible?

The non-destructive workshop

10 lessons · 1 h 29

You will be able toBuild and hand over a layered document another editor can take apart (correctly ordered, grouped, masked, named and versioned) and diagnose from the stack alone why an adjustment is affecting the wrong layers or why the file has become too slow to work in.

  1. 2.1Every edit should still be undoable next week9 min
  2. 2.2The eraser is the tool that costs you the second revision10 min
  3. 2.3Twenty-seven blend modes, six ideas10 min
  4. 2.4The same three edits in a different order give a different picture9 min
  5. 2.5Why an adjustment stopped working when you put it in a folder8 min
  6. 2.6One file, forty mockups, one change9 min
  7. 2.7The panel where selections go to live9 min
  8. 2.8The file you will need is the one from Tuesday8 min
  9. 2.9Eleven shortcuts and a scratch disk8 min
  10. 2.10Working on a laptop that cannot hold the job9 min
An illustrative case, built from documented patternsThe yearbook, the eight-gigabyte laptop, and the Tuesday crashA government higher secondary school in Pune, where one teacher builds the yearbook between classes on a five-year-old laptop.

The job and the machine

Ninety-six pages, 340 student portraits, sixty event photographs and four full-bleed spreads. No Photoshop licence, so the teacher worked in Photopea, which runs in a browser tab, is free, and reads and writes layered PSD. She had used it for two previous yearbooks without trouble.

The trouble arrived with the class-of spread: forty cut-out portraits arranged on a painted gradient background, built at 3,000 pixels square in 16-bit because the gradient banded visibly in 8-bit when she stretched it. Each portrait was a smart object with a mask and a clipped Curves layer. At about the thirty-second portrait the tab reloaded, and two hours of arrangement went with it.

The mechanism is not mysterious. Photopea lives inside a browser tab’s memory allocation, which is roughly two to four gigabytes depending on the browser and the machine, and there is no scratch disk to overflow into. A desktop application in the same position writes to disk and crawls. A browser tab in the same position stops.

The choice

Move to GIMP. Free, tile-based memory management, swaps to disk, so on an eight-gigabyte laptop a large file is slow and keeps working, which is usually the more useful behaviour. The cost is real: GIMP has no smart objects at all, so every scaled portrait is a resampled layer rather than a re-renderable one, and until version 3.0’s layer effects it had no true adjustment layers either, so a tone move is baked into a duplicate. Three weeks before the printer’s deadline, that is a new tool and forty placements to rebuild.

Stay and change the work. Split the document: portraits retouched in one file, the spread assembled in another from flattened TIFFs. Stamp a checkpoint and hide everything beneath it. Drop to 8-bit where the job does not need 16. Work at half size for placement and apply the settings at full. All of that is free and all of it costs her the re-editability she had been relying on.

Borrow the computer lab’s newer machine. Sixteen gigabytes, available one hour a day between practicals, and the school’s rules say files stay on the lab machine. One hour a day for a ninety-six-page book is not a plan, and a file that cannot leave the room cannot be worked on at home in the evening, which is when most of the yearbook was actually made.

What she weighed

The honest comparison was not GIMP against Photopea. It was which parts of this job need which property. The 340 portraits were reproduced at about 800 pixels on the page and needed a crop, a small exposure correction and a spot heal. Nothing there stretches a gradient, so nothing there needs 16-bit, and nothing there needs a smart object. The two gradient spreads needed 16-bit badly and needed almost no layers.

That observation split the job cleanly, and it is the part worth carrying away: the constraint was never the machine in general, it was one property of one part of the work.

How it played out

She retouched the 340 portraits in GIMP at 8-bit, in batches of forty, with the heal work on an empty layer and Sample merged on. GIMP was slow and it never stopped. The two gradient spreads she built in Photopea at 16-bit with every other tab closed and nothing else in the document, stamping a checkpoint and hiding the stack beneath it every twenty minutes. The composite spread was assembled from flattened TIFFs rather than from live smart objects, which cost her the ability to swap a portrait without redoing its placement, and she swapped two.

The habit that came out of it was the file names. Every stage went to disk as yearbook_spread-classof_v01.xcf through v09, zero-padded, with a version saved before every flatten, copied to the school’s Drive and to a pen drive she took home. Drive is a replica rather than a backup (a deletion syncs like everything else), but the pen drive lived in a different building, which was the point.

The book went to the printer four days early. The spread that had crashed was rebuilt in one evening the second time, because by then she knew which forty files she wanted and in what order.

Worth arguing about

  1. Why did Photopea stop rather than slow down, and what would GIMP have done in the same position?

    One answer

    Photopea runs inside a browser tab and is limited to that tab’s memory allocation, typically two to four gigabytes, with no scratch disk to spill into. When it runs out there is nowhere to go, so the tab reloads. GIMP and Krita have tile-based memory management and swap to disk, so the same document becomes slow and keeps working. On a laptop short of memory, degrading gradually is usually the more useful failure, which is why the choice of tool here is an architecture question rather than a quality one.

  2. She kept 16-bit for two spreads and used 8-bit for 340 portraits. Defend that split.

    One answer

    Bit depth protects a tonal stretch. A smooth gradient stretched in 8-bit maps 256 levels onto a wider range and leaves gaps, and the gaps show as bands, which is exactly the painted background on the spread. The portraits reproduce at about 800 pixels, carry ordinary photographic tone that jumps from pixel to pixel anyway, and receive only a small exposure correction, so there is no stretch to protect and no smooth area to band. Working in 16-bit there would have doubled the file size and the memory for no visible gain, which on an eight-gigabyte laptop is a cost paid for nothing.

  3. The school’s Drive folder is not a backup. Why not, and what did the pen drive add?

    One answer

    A synced folder is a replica. Delete a file and the deletion syncs; corrupt one and the corruption syncs. What sync services do provide is a version history, usually about thirty days, which genuinely returns last Tuesday’s file and is worth knowing how to reach before you need it. A real backup is a copy the live system cannot reach and overwrite. The pen drive was a second kind of storage kept in a different building, which covers the two failures Drive does not: the account or the folder being wrong, and the building itself. Three copies, two media, one elsewhere is the whole rule.

Test yourself6 questions on this modulePractice. Nothing is recorded and no score is kept.
  1. 1

    You cut a product out last week by selecting the background and pressing Delete, then saved and closed. The client now wants a little of the original shadow back. What is the cheapest route?

  2. 2

    A strong S-curve has made the skin look orange as well as more contrasty. What is the single-step fix?

  3. 3

    A Curves layer that darkened the whole image stops reaching the layers below the moment you drag it into a group and set that group to 60 per cent opacity. What happened?

  4. 4

    Your clone and heal repairs sit at the top of the stack. You change the tone curve underneath and the repairs stop matching their surroundings. Why?

  5. 5

    An exported file is missing the last round of client changes, although those changes are plainly visible in the layered document. What is the likeliest cause?

  6. 6

    A 40-layer, 60-megapixel document reloads the browser tab in Photopea and loses two hours. The same file in GIMP is slow and keeps working. What explains the difference?

Selections, cut-outs and edges

9 lessons · 1 h 20

You will be able toChoose and execute the right extraction method for a given edge (path, painted mask, colour range, luminosity, model or blend-mode composite) decontaminate the result so it carries no trace of its old background, and run a batch of cut-outs to a consistent standard with a sampling check that catches the failures.

  1. 3.1Selections are easy until you reach hair10 min
  2. 3.2Two handles and a curve: making the pen tool obey10 min
  3. 3.3Stop fighting the selection tools and paint it8 min
  4. 3.4Tolerance is a wall, fuzziness is a slope8 min
  5. 3.5Masks with no edge anywhere9 min
  6. 3.6What the one-click button is actually doing9 min
  7. 3.7Three equations, seven unknowns: why hair is hard9 min
  8. 3.8The four subjects that are not opaque9 min
  9. 3.9Four hundred cut-outs, and the twelve that are wrong8 min
An illustrative case, built from documented patternsFour hundred and twelve brass items, and the twelve that were notA two-person brassware export business in Moradabad, migrating its whole catalogue to a marketplace that requires pure white backgrounds.

The job that actually arrived

Four hundred and twelve items, photographed over three years by three different people against three different grey walls. The new marketplace wanted 2,000-pixel squares on white, the product occupying most of the frame, one main image per listing. Nobody had ever cut any of them out.

A freelancer in Delhi quoted per image, by hand, five working days. The quote was defensible and the money was not in the budget for a migration that was itself a cost. The alternative was the free pipeline: rembg for the masks, ImageMagick to flatten onto white and pad every item to the same canvas so a tall lamp and a wide tray sit at the same visual scale in the grid.

There were two complications, and they pulled in opposite directions.

Ninety of the items are polished brass. A polished surface is an image of whatever is in front of it, which in these photographs was a window, a tripod and a man in a blue shirt. A segmentation model outputs coverage, and coverage is not the right answer for a surface whose appearance is mostly reflection.

Eighteen items were an unreleased range under an agreement with a buyer in Hamburg. Running them through a web background remover means uploading photographs of an unannounced product line to somebody else’s server, under terms of service nobody in the business had read, several of which reserve the right to use uploads for improvement.

Three routes

A web service. Fastest by a distance, and the free tier returns a small image while the full-resolution file is paid. It also disposes of the confidentiality question by answering it badly.

rembg locally. Two hours to install on a machine with no graphics card, then two to five seconds per image on the CPU, unlimited, nothing uploaded. It would still fail on the reflective items, on the teapots with handle gaps, and on the pierced lattice lamps, because those are the predictable failures of a salient-object model.

Pay the freelancer for all of it. Five days, consistent quality, a bill, and no learning that stays in the business.

The decision that actually mattered was not which tool. It was whether to sort the catalogue into automatic and by hand folders before running the batch, which costs a morning of looking at 412 thumbnails and deciding, or to run everything and sort out the mess afterwards.

The part that is not about cut-outs at all

For a catalogue, the individual cut-out matters less than the set matching, and that is a set of decisions to be made once and written into the script rather than exercised four hundred times.

The canvas had to be 2,000 pixels square, because the marketplace said so. The product had to be resized to fit inside 1,800 first and then centred on that canvas, which is what gives a tall lamp and a wide tray the same hundred pixels of breathing space and stops the grid looking wrong even when every file is technically the same size. The background had to be exactly 255 white, because the platform checks automatically and rejects what is not. Shadows had to be present on everything or on nothing: a grid where half the items float is the clearest possible sign of a job done in two sittings by two people. And the file names had to be machine-readable, because 412 of them were going into a spreadsheet.

None of that is a skill. All of it is the difference between a set that looks commissioned and one that looks assembled, and it takes twenty minutes to decide and two seconds to encode.

How it played out

They spent the morning sorting. Ninety reflective items, eleven lattice lamps, seven trays with pierced rims and four glass-lidded jars went into a by hand folder. The remaining 300 went through rembg and an ImageMagick line that resized to fit 1,800 pixels and centred that on a 2,000-pixel white canvas, so every product got the same margin regardless of shape.

The checking was three passes. A contact sheet of the finished files at 200 pixels found thirteen catastrophes in about three minutes: two items that came out as silhouettes, one where the model had taken the shadow instead of the object, one upside down. A second contact sheet built from the masks on a mid-grey background found six more that the white sheet had hidden: two teapots whose handle gaps had been filled in, and a spice box whose edge had been chewed. Twenty opened at 100 per cent found two with the soft, approximate outline that comes from a model running at its own internal resolution and scaling the mask up.

Twenty-one bad cut-outs out of 300, all found, in under half an hour of checking. The reflective items were done by hand over the following two days using a Multiply plate and a Screen plate rather than a mask, which is the only thing that works on brass.

The marketplace then rejected four files on a rule nobody had read: the product had to occupy at least eighty per cent of the frame, and four thin items did not. The pipeline was changed in one place (the resize target) and rerun for those four.

The sentence they could put in an email to Hamburg, truthfully, was that no photograph of the new range had left the office.

Worth arguing about

  1. The grey contact sheet built from the masks found six errors the white one had hidden. Why?

    One answer

    Both sheets show the same files, but against white the two commonest mask faults are invisible. A filled-in handle gap is white where it should be transparent, and on a white background white and transparent look identical. A chewed edge eats a few pixels of product and replaces them with white, which against white is also nothing to see. Composited on mid-grey, both jump out immediately because the transparent regions are now a different tone from the page. It is the pass most people skip, and it is the one that finds the failures characteristic of the model rather than the failures characteristic of the photograph.

  2. Which categories should be pulled out before a batch runs, and what is the mechanism behind each failure?

    One answer

    Transparent and reflective objects, because the model outputs a per-pixel coverage value and the correct answer for glass or polished brass is not coverage at all: it is transmission and reflection, which need Multiply and Screen plates rather than a mask. Products with enclosed gaps (handles, rings, open boxes, mesh) because a model trained on human-drawn masks of solid bodies tends to produce closed, plausible silhouettes. Anything with fine structure such as chains, lace or wire, because those few pixels contribute almost nothing to the training objective, so the model is barely penalised for losing them. And very pale products on a pale background, where there is no contrast to work from.

  3. What did running the models locally buy the business, beyond the money?

    One answer

    Two things. First, a statement they can make to a customer and stand behind: no photograph of the unreleased range left the premises, which is not a claim you can make about a web service whose terms you have not read and several of which permit training on uploads. Second, independence: the pipeline is two commands on their own machine, with no per-image cost, no queue, no price change and no service that can be withdrawn. The cost was two hours of installation and a slower per-image time on a machine with no graphics card, which for 300 images at a few seconds each was irrelevant.

Test yourself6 questions on this modulePractice. Nothing is recorded and no score is kept.
  1. 1

    A pixel at the edge of hair against a wall is genuinely about 40 per cent hair. Why can no tool derive the correct foreground colour from that pixel alone?

  2. 2

    A subject cut from a green wall shows a green rim against white. Contracting the selection by a pixel removes the rim and most of the fine hair with it. What addresses the cause?

  3. 3

    You need a selection of sky seen through bare branches. Why is Colour Range a better tool here than the Magic Wand?

  4. 4

    You lift the shadows in a landscape through an inverted luminosity mask and get no halo along the roofline, where a hard selection always produced one. What prevented it?

  5. 5

    An automatic cut-out of a teapot comes back with the gap between the handle and the body filled in. Which property of the model explains it?

  6. 6

    You check 400 automatic cut-outs by opening twenty at full size, chosen to cover the hardest cases, and all twenty pass. What have you established?

Tone and colour

10 lessons · 1 h 30

You will be able toTake a set of unevenly lit photographs to a consistent, defensible tonal and colour result: diagnosing casts from per-channel evidence, correcting mixed lighting locally, shaping form without banding or halos, and stating what you measured rather than what looked right on your screen.

  1. 4.1Brightness/Contrast is one knob for a problem with five10 min
  2. 4.2There is no correct histogram9 min
  3. 4.3Two light sources, one global slider9 min
  4. 4.4Shaping light by hand, on a grey layer9 min
  5. 4.5Why Clarity makes halos, and what Dehaze is estimating9 min
  6. 4.6Saturation is a slider that destroys detail quietly8 min
  7. 4.7Monochrome is a decision about which colours become which greys9 min
  8. 4.8A look is a mapping, and a LUT is a table of it9 min
  9. 4.9There is no correct number for skin10 min
  10. 4.10Forty photographs that have to look like one shoot8 min
An illustrative case, built from documented patternsOne hundred and eighty graduates, one corridor, and a camera that kept decidingA degree college in Hyderabad photographing its graduating year in a corridor between the library and a window, on the one day everybody was on campus.

The setup, and what was wrong with it

A borrowed camera on a tripod, a maroon cloth backdrop taped to a noticeboard, six-minute slots, and a student from the photography club operating it. Daylight came through a window on the left. Fluorescent tubes ran along the ceiling. Everything was on automatic: automatic exposure, automatic white balance, and the camera shooting JPEG because nobody had thought about the card filling up.

By the time a lecturer looked at the files at lunch, sixty-three students had been photographed and two problems were visible on the laptop screen.

The exposures were not consistent, and they were not randomly inconsistent. The camera’s meter reads the frame and pulls towards a middle value. A student with dark skin fills much of the frame with a dark subject, so the meter concluded the scene was under-lit and opened up, or, in the sequence where the backdrop dominated, did the opposite and pulled down. Across the sixty-three, the darker-skinned students were on average noticeably under-exposed, and the failure was systematic rather than scattered.

The backdrop wandered. Automatic white balance re-decides per frame. A frame with a lot of maroon in it reads as a colour cast and gets corrected towards neutral, taking some of the maroon with it. Sampled with a 5 by 5 average, the backdrop measured between 243 and 251 across the set and carried a slight green shift on the frames where the tubes had dominated over the window.

No individual photograph looked wrong. The set, laid out as a contact sheet, looked assembled rather than commissioned.

The decision at lunch

Stop, go manual, reshoot the sixty-three. Correct, and forty-one of those students had already left campus, several of them travelling home that evening and not returning before the prints were needed.

Carry on and fix it in the developer. Nine hours of per-frame work, and the arithmetic of the under-exposed frames is unkind. Lifting exposure afterwards multiplies the signal and the noise together, and on an 8-bit JPEG it does so inside 256 levels. On darker skin, where much of the form is carried by the specular highlights, a heavy global lift also flattens the face, which is a worse outcome than the under-exposure it is fixing.

Switch to manual now and match the first sixty-three towards the second set. Cheapest, and it accepts two sets that a contact sheet will always be able to tell apart.

The cost was on both sides and it was not only technical. Asking forty-one students to come back is asking forty-one people for an hour of a week they had already finished.

The decision made three weeks earlier

There was a fourth cost, and it had been incurred before anybody picked up the camera. The club had set it to shoot JPEG so the card would not fill.

In a raw file, white balance is a pair of multipliers that have not been applied yet, so changing it costs nothing at all. In a JPEG it has been baked in, and correcting it means stretching one channel against the others inside 256 levels. Correcting a green fluorescent cast in a JPEG means multiplying part of the green channel down and the others up; a channel stretched that far bands in the smooth areas and goes noisy in the dark ones, and in the deepest shadows there is nothing left to stretch.

The same argument applies twice over to exposure. A raw file at 12 or 14 bits carries levels in the shadows that an 8-bit gamma-encoded JPEG simply does not have, which is exactly the region the under-exposed frames needed lifting from.

So the frames that most needed correcting were the frames least able to take it, and the reason was a setting chosen for storage on a day when storage was not actually the constraint.

How it played out

They switched to manual exposure and manual white balance after lunch, shot a grey card frame at the start of each of the three remaining lighting changes, and put a notice on the department board that anyone photographed before half past twelve could come back on Monday morning. Twenty-two returned.

The remaining forty-one were corrected individually rather than in a batch. White balance came from the whites of a shirt or from the backdrop where no shirt was available; exposure was raised in the developer; and the specular highlights on the face were deliberately left alone rather than recovered, because on those frames the highlights were most of what gave the face shape. The corrections were done as masked local adjustments per student, not as one global move, which is ordinary professional practice and not an admission of failure.

The prints went out on time. Put side by side, the two sets are distinguishable, and the mid-grey contact sheet is where that shows, which is why the department now builds one before anything goes to the printer.

Two rules were written into the photography club’s one-page sheet afterwards. Expose for the skin, not for the average. And never let the camera decide the same thing twice.

Worth arguing about

  1. Why did the meter underexpose some students and not others, and what is the fix at capture rather than in post?

    One answer

    A camera’s meter has no idea what it is looking at; it measures the light reaching it and pulls the exposure towards a middle value. A frame filled with a darker subject measures lower, so the automatic system moves the exposure in a direction that is wrong for that subject, consistently and in the same direction every time. The failure is systematic rather than random, which is exactly what makes it invisible frame by frame. The fix at capture is manual exposure set for the skin rather than the average (spot meter on the face, or add a stop and check the histogram) and then not letting the camera re-decide between frames.

  2. Why is lifting the exposure afterwards not equivalent to having exposed correctly?

    One answer

    Because a lift multiplies whatever is in the shadow, and what is in the shadow is signal plus noise. A correctly exposed frame carries more signal relative to the noise floor to begin with. On an 8-bit JPEG the problem compounds: the stretch spreads 256 levels over a wider range and leaves gaps, which show as banding and blotches in the smoother areas of skin. There is a second cost specific to this job: a heavy global lift also pulls up the specular highlights that carry much of the form on darker skin, so the face flattens. That is why the corrections here were local and masked rather than global.

  3. No single frame was wrong, and the set still looked wrong. What was the measurement that showed it, and why did it have to be made on grey?

    One answer

    Sampling the backdrop with a 5 by 5 average eyedropper on several frames and comparing the numbers: between 243 and 251 across the set, with a green shift on some. The eye is very good at comparison and very bad at memory, so the difference is invisible one file at a time and obvious in a grid. The grid has to be laid out on mid-grey rather than white, because white hides exactly the difference being hunted: a 250 background and a 255 background both read as white against a white page, and the whole question is whether they match.

Test yourself6 questions on this modulePractice. Nothing is recorded and no score is kept.
  1. 1

    A standard S-curve makes the picture punchier and costs you detail in the highlights and shadows. Where did the extra midtone contrast come from?

  2. 2

    A photograph of a deep red flower looks correctly exposed on the luminosity histogram, and every petal has lost its internal shading. Which view would have shown the problem?

  3. 3

    An office interior has a green cast on everybody’s faces, and the temperature slider only makes it bluer or more orange. What is the reason?

  4. 4

    Why do retouchers dodge and burn on a 50 per cent grey layer set to Soft Light rather than using the Dodge and Burn tools in the toolbar?

  5. 5

    Clarity at +60 puts a bright band in the sky along every branch and a dark band inside the branches. What is producing the bands?

  6. 6

    You raise saturation until a red rose looks vivid on screen, and each petal becomes a single flat shape. What has happened inside the file?

Repair and retouching

10 lessons · 1 h 33

You will be able toRepair a damaged or imperfect photograph to a professional standard using the right mechanism for each fault (separated frequencies, patch synthesis, manual reconstruction or warp) and state precisely which faults in a given file are unrecoverable and why.

  1. 5.1Three tools that all remove a spot, and they are not interchangeable11 min
  2. 5.2Splitting texture from tone10 min
  3. 5.3Keep what is permanent, remove what is passing9 min
  4. 5.4The product has to be the product9 min
  5. 5.5A reflection is a photograph of the light source9 min
  6. 5.6Rebuild the structure first, then the texture9 min
  7. 5.7Moving pixels, and the straight line that gives it away9 min
  8. 5.8Getting the photograph off the paper9 min
  9. 5.9Tears, mould and the cyan that faded first9 min
  10. 5.10Four losses that no tool undoes9 min
An illustrative case, built from documented patternsThe 1971 wedding photograph, and the face that is only in one other frameA small photo studio near Naveen Market in Kanpur, where restoration pays better per hour than passport photographs.

What came in

A colour print, five inches by seven, from a wedding in 1971. Salmon-pink overall. A tear running up from the lower left corner, and the corner itself missing: about two centimetres of what had been a plain wall. And a crease, folded and refolded, running diagonally across the grandmother’s left eye and cheek.

The pink is not the paper yellowing. Chromogenic colour prints hold three dye layers, and they do not fade at the same rate; in the common processes the cyan goes first. Remove cyan from cyan, magenta and yellow and what is left reads as red-orange. That is why every family photograph from this period has the same cast, and it is why the correction is a red-channel curve pulled down in the midtones rather than a warmth slider.

The limit is equally specific. Where the cyan dye has gone, there is no cyan information to amplify. You can neutralise the cast and what you get back is a low-saturation, greyish image, because the data in that channel is absent rather than weak. Pushing further produces channel noise and banding, not colour.

The tear and the missing corner were straightforward: a tear is a tonal line over surviving image, and the corner had contained nothing but wall, so it could be cloned from the opposite corner. Real content, correctly derived.

The crease across the eye was the job.

The decision

The family had brought a second print from the same day. It is badly out of focus and it shows the grandmother from the other side, three-quarters rather than near-frontal.

Rebuild the eye from the second print. Six hours: extract the eye region, warp it to the new angle, match the grain and the tone, sharpen it to sit with its surroundings. The result would be derived from surviving evidence of that person on that day. Six hours is not in a two-and-a-half-thousand-rupee restoration.

Generate or hand-paint an eye. Forty minutes. It would be a plausible eye. It would not be her eye, and it would hang on a wall a grandchild grows up looking at.

Reduce the crease and leave it visible. Two hours, entirely honest, and the family will see the crease every time they pass it.

The studio’s owner does this arithmetic often enough to have a rule about it: the decision belongs to the family, and it cannot be made by them unless somebody explains the difference between the three, which takes about four minutes and is the part most studios skip.

Why the order of work was not negotiable

There was a second decision, smaller and entirely technical, about what to do first.

The instinct on a damaged print is to start with the interesting part, which here was the eye. Doing that costs you the work twice. Restoration runs from large damage to small: archive the untouched scan, recover global tone, correct the global colour, then the tears and missing corners, then the creases and stains, then the dust, then local tone, then grain matching, then output.

The reason is that every large repair changes what the small ones have to match. Repair a crease against a faded, pink, low-contrast original and then recover the contrast, and the repair is now visibly a different tone from everything around it. Recover the contrast first and a surprising amount of what looked like catastrophic damage turns out to be faint: on this print, two marks that had been quoted as stains disappeared entirely once the black point was where it belonged.

Working small to large means redoing the small work after every large repair. Working large to small means doing it once.

How it played out

He quoted the six-hour option separately and explained why it cost more, showing them the second print and pointing at the eye. The family agreed to the higher price, which he had not expected.

The work ran large damage to small, which is the order that stops you redoing things. Global tone first, to recover contrast from a faded original: a good deal of what had looked like catastrophic damage turned out to be faint once the contrast was back. Then the cast. Then the tear and the missing corner. Then the crease, worked on a frequency-separated pair so the tonal line was evened on the low layer and the skin texture replaced on the high layer, with the lasso stopped short of the jaw where the blur mixes face and background. The eye came last, from the second print, warped and tone-matched, then grain matched across the whole repair.

The colour result was flat, as it had to be. He also made a monochrome version, and that is the one the family framed, which is common enough that he now offers it before it is asked for.

Four files were delivered: the untouched scan at 600 dpi, the colour restoration, the monochrome, and a plain-text note. The note says that the lower left was reconstructed from the surrounding wall, that the corner was cloned from the opposite corner, that the colour cast was corrected but the cyan dye layer had substantially faded so the colours are approximate, and that the grandmother’s left eye was rebuilt from the second photograph supplied by the family.

Worth arguing about

  1. Why is the print pink, and exactly what can and cannot be recovered from that?

    One answer

    The print holds cyan, magenta and yellow dye layers, and in the common chromogenic processes the cyan is the least stable and fades first. What remains (magenta and yellow) reads as red-orange. The correction is therefore to add cyan back, which means pulling the red channel down in the midtones and highlights where the cast is worst. What cannot be recovered is the information the cyan layer held: once that dye has gone there is no weak signal to amplify, so neutralising the cast returns a greyish, low-saturation image. Pushing harder produces channel noise and banding rather than colour, which is why a good monochrome conversion is often the honest and better-looking answer.

  2. Why was the crease treated on a frequency-separated pair rather than healed directly, and where did the lasso have to stop?

    One answer

    A crease is a tonal line over surviving image: the emulsion is cracked but the picture either side is intact. Separating the photograph into a blurred tone layer and a neutral-grey detail layer lets the tonal line be evened on the low layer, where there is no texture to destroy, while the skin texture is replaced on the high layer, where there is no tone to get wrong and therefore no pale disc left behind. The lasso has to stop short of the jawline, because the blur that built the low layer has mixed face and background across that boundary; working on the low layer there produces a visible pale halo tracing the edge of the face.

  3. Rebuilding the eye from the second print and generating one both put pixels there that were not in the original file. What makes them different acts?

    One answer

    Provenance. The rebuilt eye is derived from surviving photographic evidence of that person on that day, transformed, warped and tone-matched, but traceable to a real record. A generated eye is a sample from a distribution of what eyes look like; it is plausible and it is about nobody. The practical difference shows in what can be written down: the delivery note can say which frame the eye came from and what was done to it, and a grandchild can check. For a family photograph on a wall many people would accept the generated version, and the rule is that they should be told that is what it is, which the note makes automatic rather than a matter of remembering.

Test yourself6 questions on this modulePractice. Nothing is recorded and no score is kept.
  1. 1

    You heal a cable where a pale wall meets a dark worktop and get a grey smear. Which tool is right and why?

  2. 2

    Why does healing a spot on the high-frequency layer not leave the pale disc that healing the flat photograph sometimes does?

  3. 3

    A sample jar has a dent in its cardboard box and a scratch on the lid that the production units will also have. What does the governing test for product work permit?

  4. 4

    What is the reliable way to check whether a photograph has been reshaped with Liquify?

  5. 5

    Which of these is an absence of information rather than a fault in it, so that no tool reverses it?

  6. 6

    A client sends a photograph to be enlarged to A3. Which single check tells you fastest whether the job is possible?

Compositing: making two pictures one

9 lessons · 1 h 17

You will be able toCombine elements from different photographs into one image that survives inspection (matching perspective, scale, light direction and quality, edge softness, depth of field and grain) and merge multiple exposures, viewpoints or focus planes of one scene without halos, ghosting or parallax errors.

  1. 6.1Six mismatches, and the eye finds them all8 min
  2. 6.2The horizon tells you where the camera stood9 min
  3. 6.3Relighting a cut-out so it belongs9 min
  4. 6.4Constructing what the light would have done9 min
  5. 6.5A new sky changes the light in the whole photograph8 min
  6. 6.6Two exposures of one scene, and how not to make it look like HDR9 min
  7. 6.7Many frames, one view, and the pivot point that matters9 min
  8. 6.8When depth of field is not enough8 min
  9. 6.9The last tell: texture and depth8 min
An illustrative case, built from documented patternsThe blue sky that was still grey in the windowsAn estate agency in Thane with eleven flats to list before the end of the month and a week of monsoon cloud.

The photographs they had

A four-storey building with glass balcony fronts, a tiled forecourt still wet from the morning, and two cars parked along the near side. Shot on a flat white overcast day, because that was the day the keys were available. The agency’s house style, like most of its competitors’, puts a blue sky behind every exterior.

The junior who had been given the files ran an automatic sky replacement on the first one. The masking round the neem tree at the edge of the frame was better than he would have managed by hand in an hour, and the result was obviously wrong in a way he could not immediately name.

It was wrong in the way a sky replacement is always wrong when nobody checks the four agreements.

Direction. The new sky had a bright area low on the right. The building’s soft shadows, such as they were, did not agree with anything, because an overcast day produces no directional shadow at all.

Quality. This is the one that does the damage. The original light was soft, so nothing in the frame casts a hard shadow. Put a clear sky with a visible sun behind it and the scene becomes a bright day in which nothing casts a shadow, which every viewer registers instantly and almost nobody can articulate.

Exposure relationship. Against a bright sky, the building stayed at its overcast exposure and read as dull and slightly grey.

Spill. Nothing in the scene had been lit by the new sky. Roofs, the tops of the cars and the wet forecourt all carried the colour of the old one.

And then the thing that actually killed it: the old sky was still in the building. Grey, in every balcony pane, in the puddles on the forecourt, and along the top of both cars.

Three routes

Replace properly. Choose a sky whose light matches the plate rather than the other way round, add horizon haze, grade the foreground, add spill, and then replace the reflection in every pane of glass, every puddle and two car roofs. That is the better part of a day per photograph, and eleven listings were due.

Improve the sky that is there. A graduated Curves layer over the existing flat sky, twenty minutes, no new content, no reflections to chase. The sky stays grey.

Wait for a clear morning. The photographs are correct and the listing goes live a week later, in a market where the first week carries most of the enquiries.

The check that would have taken thirty seconds

The junior had looked at the replaced sky at fit-to-screen for ten minutes and knew something was wrong without being able to name it. Three checks would have named it, and all three are seconds of work.

Flip it horizontally. The eye habituates to an image quickly, and a mirrored version is unfamiliar again, so errors that had stopped registering reappear. Flip back afterwards.

Shrink it to 300 pixels. Errors of tone, contrast and light direction survive at that size and errors of edge detail disappear. If it still reads as wrong small, the problem is structural rather than in the mask, which is what it was here.

Blur it heavily. Twenty pixels of Gaussian on a flattened copy leaves only the broad tonal and colour structure. The building stayed a dull grey lump under a bright sky, which is the exposure relationship failing, and it was obvious in a way it had not been at full size.

None of those checks needs experience. They need somebody to have been told that they exist.

How it played out

The agency’s principal made the call, and she made it per photograph rather than as a policy.

For the eight flats where the interiors were the subject and the exterior shot showed little sky, they used the graduated Curves version: twenty minutes each, no reflections involved, and nobody has ever asked about them. For the three where the building itself is the selling point, they waited for a clear Saturday and reshot. The listings for those went live six days later than planned.

The one photograph that had already been replaced and published was pulled after a viewer, standing in the flat, pointed at a balcony pane in the listing photograph and asked why the sky in it was grey. That conversation cost more than the week.

The agency added one line to its listing descriptions (the date the photographs were taken, and a note that skies are not replaced) initially as a defensive measure and then because two sellers said it was why they had chosen the firm. What was intended as a limitation turned out to be the only thing in the listing that could be checked.

Worth arguing about

  1. Name the four things that must agree when a sky is replaced, and say which of them an automatic tool cannot fix.

    One answer

    Light direction, light quality, the exposure relationship between sky and ground, and colour spill onto everything the sky lights. Automatic tools do a good job of the masking and make a reasonable attempt at the colour grade and the spill, both of which are adjustments to values. What they cannot fix is light quality: the softness or hardness of the shadows is already baked into the pixels of the foreground, and no adjustment makes a soft shadow hard. That is why the sky has to be chosen for the plate rather than the plate adjusted to the sky, and choosing is a judgement the tool does not make.

  2. Why did the reflections defeat this composite, and what would fixing them have cost?

    One answer

    A sky is the scene’s light source, so its image appears wherever the scene is reflective: glass, water, wet paving, car paint. Replacing the sky above the roofline while the old grey sky is still visible in every balcony pane leaves a contradiction that survives every other correction, and it is exactly what a viewer standing in the flat will compare against reality. Fixing it means masking and replacing each reflective surface separately, with the new sky’s colour and brightness, distorted by the geometry of each pane and each puddle: most of a day per photograph, on eleven listings due the same month.

  3. Is sky replacement acceptable in estate agency work? Give the test rather than a verdict.

    One answer

    The test is whether the picture is a record or a construction, which is determined by its use rather than by how it was made. A photograph on a poster advertising a development is a construction and nobody is misled. A listing photograph is offered as a record of a specific property, and a buyer treats it as evidence of what they would be buying, which is why sky replacement has become a point of complaint in several markets and why disclosure conventions are emerging. The working question (would the viewer be surprised to learn what was done) answers it here, and a line in the listing costs nothing.

Test yourself6 questions on this modulePractice. Nothing is recorded and no score is kept.
  1. 1

    You are placing a photograph of a standing person into a street plate. What fixes their scale exactly rather than approximately?

  2. 2

    A composited box has a long soft cast shadow and still looks as though it is hovering a centimetre above the table. What is missing?

  3. 3

    A building with glass balconies, photographed on a grey day, resists sky replacement. Which problem cannot be solved by grading the foreground?

  4. 4

    Why does heavily tone-mapped HDR have bright bands along every roofline?

  5. 5

    A hand-held panorama of a courtyard stitches perfectly in the distance and doubles a foreground railing along one seam. What went wrong?

  6. 6

    You have added grain to a composited element to match a noisy plate, and it still reads as pasted. What is the fix?

AI inside the image editor

9 lessons · 1 h 19

You will be able toUse generative fill, outpainting, upscaling, denoising and colourising deliberately (predicting each one’s characteristic failures from its mechanism, running free local equivalents where confidentiality or cost requires it) and state for a given image whether generated content is permissible and what has to be disclosed.

  1. 7.1Noise in, picture out: inpainting explained10 min
  2. 7.2Getting a usable result in three attempts instead of thirty9 min
  3. 7.3Making a photograph bigger than it was taken8 min
  4. 7.4Which upscaler, for which material9 min
  5. 7.5Reconstruction sold as noise reduction9 min
  6. 7.6A guess about what colour the dress was8 min
  7. 7.7On your own machine, with no graphics card9 min
  8. 7.8What can be proved about where an image came from8 min
  9. 7.9The decision, and the parts nobody has settled9 min
An illustrative case, built from documented patternsOne classroom photograph, five shapes, and a consent form that did not mention itAn education NGO in Ranchi, preparing a donor report, a website hero and three social formats from a single good photograph.

One frame that works

Out of four hundred photographs from a field visit, one is right: light falling through a doorway onto a teacher at a board, nine children at desks, a wall of exercise books behind. It is a 4:3 frame with the teacher a third of the way in from the left.

The report needed it at five shapes. Square for the donor’s grid, 4:5 for the feed, 9:16 for a story, 16:9 for the website hero, and 3:1 for a banner across the top of a landing page. Cropping to all five works for two of them and destroys the composition in three: the 3:1 crop leaves a strip containing the teacher’s shoulder and half a child.

The obvious answer is generative expand: extend the canvas and let a diffusion model fill the new area, conditioned on the pixels along the boundary. It is genuinely the most useful everyday application of generative imaging in commercial work, and it is the least discussed.

What made it not obvious here

The photograph shows nine identifiable children. Their parents had signed a consent form, written in Hindi and English, covering the NGO’s annual report and its website.

The form says nothing about uploading the photograph to a third-party service. A hosted generative expand means sending an identifiable image of minors to a company whose terms of service nobody in the office had read, several of which reserve rights over uploads.

The communications officer laid out three options in a note to the programme head.

Hosted expand. Two minutes per ratio, the best first result, and it puts the photograph somewhere the consent form does not reach.

Local expand. Fooocus on her own laptop, which has no graphics card. An afternoon to install and understand, then about three minutes per generation. Nothing leaves the machine. It still generates content that was never in that room, and in the first attempts at 9:16 it twice produced an extra child-shaped figure at the lower edge, which is a characteristic failure at the boundary of an outpaint around people.

No model at all. Mirror the edge where the extension is pure texture (floor, wall) and place the photograph on a coloured panel with the report’s title for the two extreme ratios. Exact, free, deterministic, invents nothing, and it reads as design rather than as more room.

The cost on the third option is real and worth stating: it looks like a layout rather than like a photograph, and the donor’s own materials are full of full-bleed photographs. Choosing it is choosing to look different from everybody else in the folder.

The workflow that would have applied either way

One thing was settled before the confidentiality question arose, because it is settled in every job of this shape: you do not run five separate extensions for five ratios.

Extending a canvas five times from the same original produces five different inventions of the same wall, and they do not agree with each other, so the set looks like five photographs of five rooms. The professional route is to extend the master generously in both directions once, keep the extension on its own layers, and then crop that single file to each ratio. One generation, five outputs, and the subject sits where it should in all of them.

The extension itself has to be staged. Asking for a hundred per cent more width in one operation gives the model a thin strip of real pixels along one edge to condition a very large region, and it drifts: the wall changes colour, the floor line bends. Twenty to thirty per cent at a time, with a generous band of the existing image inside each generated region, gives each pass enough context to stay coherent.

And whatever comes back is cleaner than the photograph it is attached to, so grain, vignette and black point have to be unified across the whole extended frame afterwards.

How it played out

The programme head chose the third option for 3:1 and 9:16, with the report’s title set on a deep green panel beside the photograph. For 16:9 they used a twenty per cent local outpaint, where the new area was floor and wall texture and the boundary was nowhere near a person, then matched grain and black point across the whole frame so the extended strip did not read as cleaner than the photograph. Square and 4:5 were straight crops.

Nothing was uploaded. The asset folder carries a one-line note against the 16:9 file saying the canvas was extended by twenty per cent on the right by a local model, and the original frame sits beside it.

The part that outlasted the report was the consent form. It was rewritten for the following year, in Hindi and English, to say what the photographs would be used for, that they would not be altered beyond cropping and colour correction without asking again, and that they would not be sent to services outside the organisation. The field team reported that it took about ninety seconds longer per family to explain and that no family refused.

Worth arguing about

  1. Why is extending a photograph a sharper honesty problem than removing something from one?

    One answer

    Removing an object is a subtraction the viewer may or may not notice. Extending the frame adds content the viewer reads as part of the scene (more of the room, more of the street) and they believe it was there because everything else in the frame was. The addition is not presented as an addition; it is presented as the rest of the photograph. That is why outpainting is unremarkable in advertising and design, where nobody is being told the world looked like this, and not acceptable in editorial or documentary work, where extending the frame fabricates the scene around the event.

  2. Mechanically, why did the outpaint produce an extra child-shaped figure, and what reduces it?

    One answer

    Inpainting and outpainting generate content consistent with the surrounding pixels, and the surroundings here contain a repeating arrangement of seated children. The model has no representation of how many children were in the room; it produces what is statistically likely given the context, and another figure is likely. The same mechanism explains why brick courses drift and why text comes out as letter-shaped marks. What reduces it is extending in smaller stages with generous overlap so each pass is more strongly constrained, keeping the boundary away from people where the composition allows, generating three variations and compositing only the parts that worked onto a masked layer, and checking, every time, rather than accepting a whole result.

  3. What did the local route buy, and what did it cost?

    One answer

    It bought confidentiality (a statement the NGO can make to parents and to a donor that no photograph of an identifiable child left the office) along with zero cost per image and independence from a service that could change its terms. It cost an afternoon of setup, about three minutes per generation on a laptop with no graphics card, and a first result that is usually a step behind the best hosted tools. For a handful of extensions that trade is easy; for three hundred it would not be. The deciding factor was not quality, and it was not money: it was that the consent form did not stretch that far.

Test yourself6 questions on this modulePractice. Nothing is recorded and no score is kept.
  1. 1

    You are removing a bin from a lawn with generative fill. Why does an empty prompt usually beat typing the word grass?

  2. 2

    A generative fill leaves a visible seam exactly on the outline of the object you removed. What is the likeliest cause?

  3. 3

    You have a noisy high-ISO frame that needs enlarging and sharpening. What is the correct order?

  4. 4

    A colouriser returns a 1940s photograph with a convincing blue sky and a muddy brown dress. Why the difference?

  5. 5

    What does running rembg and Upscayl on your own machine buy you, beyond avoiding a per-image fee?

  6. 6

    An image arrives with no Content Credentials attached. What does that tell you?

Out of the editor: size, sharpness and the delivered file

11 lessons · 1 h 44

You will be able toTake a finished edit to a delivered file for any named destination: computing the pixel dimensions from the destination rather than the source, choosing a resampling filter and a colour space by mechanism, sharpening last and at output size, selecting the codec and quality by measurement rather than habit, and predicting what a platform’s own re-encoding pipeline will do to the result.

  1. 8.1Nearest, bicubic, Lanczos: what the resize dialogue is computing10 min
  2. 8.2The width to export, and why the browser will not fix it for you9 min
  3. 8.3Sharpening adds no detail, and it goes last9 min
  4. 8.4Why your image looks washed out on somebody else’s phone10 min
  5. 8.5Stop guessing the quality slider9 min
  6. 8.6The formats that replaced JPEG, and the one that might10 min
  7. 8.7GIF is a 1987 format and you are probably still exporting one9 min
  8. 8.8The fields that say who made it, and which platforms keep them8 min
  9. 8.9One picture, six files, and letting the browser choose9 min
  10. 8.10Your file is re-encoded on upload, and you can plan for it9 min
  11. 8.11One bottle, one window, twelve minutes12 min
An illustrative case, built from documented patternsFourteen seconds to the first picture, and the bill nobody had approvedA district education portal in Jaipur, where the admissions notice is read mostly on mid-range phones over mobile data.

The measurement

Somebody in the office opened the portal’s admissions page in a browser with the network throttled to a slow connection, which is a thirty-second test that nobody had ever run. Fourteen seconds before any picture appeared. The page had thirty-one images on it and every one of them began downloading at once.

The causes were not subtle.

Almost every image was a PNG, because the staff who upload them were told years ago that PNG is the high-quality format. A PNG of a photograph is routinely three to six times the size of a visually identical JPEG, because the format is lossless and designed for flat colour and hard edges. The hero (a group photograph of a prize-giving) was 2.4 megabytes.

Almost every image was 3,000 to 4,000 pixels wide, straight from a camera, displayed in a column about 700 CSS pixels across. On a ratio-2 phone that column needs roughly 800 real pixels. The browser downloads all four thousand of them, then scales down in encoded space with no gamma correction and no output sharpening, which is also why the pictures looked slightly soft.

And nothing was lazy-loaded, so a thumbnail in the footer competed for bandwidth with the photograph at the top of the page.

The choice

An image CDN. Ten minutes to switch on. One master per image and derivatives come from URL parameters (width, format, quality) so the widths and formats problem disappears without anyone re-exporting anything. It is a monthly bill against a budget line that does not exist, and it is a dependency: every image on a government portal would then be served through a private company’s infrastructure, on their pricing and their uptime.

Fix it properly, themselves. Re-export 900 images to three widths in three formats with a shell loop, write srcset and sizes into the article template, and change the upload rule in the CMS so staff cannot post a 4,000-pixel file at all. Free, permanent, and two days of a developer who is the only developer and does not have two days.

Do the cheap half. Fix the twelve pages that carry most of the traffic, set the loading and priority attributes site-wide, and leave the rest until there is time.

The temptation was the CDN, because it is a decision that can be made in a meeting and finished the same afternoon. The argument against it was not technical: it was that the underlying problem (staff uploading camera files) would be hidden rather than solved, and the bill would grow with the site.

Arguing in budgets rather than in settings

The meeting where this was decided nearly turned into an argument about the quality slider, which is an argument nobody wins because a quality number is not comparable between two encoders and does not describe an outcome at all. It scales a quantisation table. Feed it a plain studio backdrop and quality 82 gives a small, perfect file; feed it a crowd under autumn foliage and the same setting gives a large file that still shows artefacts.

What ended the argument was a budget. A full-width photograph on a page gets 100 to 300 kilobytes; a grid thumbnail gets 15 to 40; a whole article page including its images aims under a megabyte, and going over it is a decision somebody makes rather than something that happens.

That converts an aesthetic disagreement into arithmetic. If the hero has to be 1,000 pixels wide and fit 200 kilobytes, the quality setting is whatever achieves that, found by exporting two versions and flipping between them at 100 per cent rather than by nominating a number in advance.

How it played out

They did the cheap half first, in one afternoon. The twelve highest-traffic pages had their images re-exported: the 2.4-megabyte hero PNG became a 1,000-pixel JPEG at quality 80 and 180 kilobytes, converted to sRGB and stripped of metadata. Everything below the fold got loading="lazy". Time to the first picture on the same throttled connection went from fourteen seconds to 3.1.

They got one thing wrong on the way, and it is the instructive part. The first pass marked every image lazy, including the hero, and the measured number got worse rather than better. The image at the top of the page is usually the element the browser’s own load-time metric is timing, and marking it lazy pushes its request behind the others. Removing the attribute from the hero and adding fetchpriority="high" recovered more than a second.

The proper fix followed over the next month, one section at a time: an ImageMagick loop producing 400, 800 and 1,600-pixel versions in AVIF, WebP and JPEG, a <picture> block in the template with sizes written from the same definition as the stylesheet, and a CMS rule refusing uploads over 2,000 pixels with a message explaining why. The CDN was never bought.

One detail they nearly missed: several older PNGs carried an Adobe RGB profile, and the pages that had been converted rather than merely re-saved were the ones that stopped looking washed out on phones.

Worth arguing about

  1. Why were the PNGs the wrong format here, and what did that cost specifically?

    One answer

    PNG is lossless and designed for hard edges, flat colour and transparency: screenshots, logos, diagrams. A photograph stored losslessly keeps detail that a viewer could never miss, so the file is routinely three to six times the size of a visually identical JPEG or WebP. On this page it meant a 2.4-megabyte hero where 180 kilobytes was indistinguishable, multiplied across thirty-one images, delivered to readers paying for mobile data. The correct rule is to pick the format by what is in the picture: photographs as JPEG, WebP or AVIF, and flat graphics and anything needing an alpha channel as PNG.

  2. Marking every image lazy made the measurement worse. Why?

    One answer

    Lazy loading tells the browser not to fetch an image until it is near the viewport, which on a long page is the single biggest saving available, for everything below the fold. The image at the top of the page is usually the Largest Contentful Paint element, the thing whose arrival the browser’s own performance metric is timing. Marking it lazy deprioritises exactly the request that defines when the page looks loaded, so the number goes up. The rule is everything below the fold lazy, the hero not lazy and marked high priority, and width and height on every image so the layout does not jump as they arrive.

  3. The CDN would have solved the widths and formats in ten minutes. Why was fixing the dimensions first the better order?

    One answer

    Because dimensions are a first-order saving and compression is a second-order one: shaving bytes off a 4,000-pixel file being displayed at 800 is tidying a room that needs a wall moved. A CDN would have hidden that by generating correct derivatives on request, while staff carried on uploading camera files and the bill grew with the site and with the traffic. Doing the export themselves also let them change the cause (a CMS rule that refuses oversized uploads) which is the part that survives the next person to join the team. The CDN’s real costs were the recurring bill against a budget line that did not exist and a dependency on a private service for every image on a government portal.

Test yourself6 questions on this modulePractice. Nothing is recorded and no score is kept.
  1. 1

    An image sits in a 600 CSS-pixel column, and most readers are on phones with a device pixel ratio of 2 or 3. What width should you export?

  2. 2

    A photograph exported at 800 pixels looks crunchy, with pale rims around every branch. It was sharpened at 4,000 pixels and then resized. Why does that show?

  3. 3

    A photograph edited in Adobe RGB looks flat and dull on a marketplace listing. What should have been done before export?

  4. 4

    JPEG quality 82 produces a 95 KB file for a plain studio backdrop and a 470 KB file for a frame of autumn foliage. Why?

  5. 5

    A three-second screen recording exports as a 4 MB GIF and as a 250 KB MP4. What makes GIF so expensive?

  6. 6

    You mark every image on a long page as lazy-loaded and the measured load time gets worse. Why?

What this course is

Raster editing as a working craft. What resolution can and cannot be recovered, why every edit belongs on its own layer, how masks separate people who can edit from people who cannot, selections down to hair, Levels and Curves instead of Brightness/Contrast, the difference between healing and cloning and generative fill, sharpening done last, and export settings that survive a slow connection. Photoshop is named; Photopea, GIMP and Krita are the paths that cost nothing.

Who wrote it

Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.

More in Make things

  1. Making Things with AI84 lessonsImages, video, voice and music: how they work, where they break, who owns them.
  2. Design, before Any Software74 lessonsHierarchy, type, colour and spacing: the part of design you can do with a pencil, before any software.
  3. Vectors, Logos and Things That Get Printed73 lessonsDraw curves that hold at any size, then hand a press a file it will not send back.
  4. Image Generation, in Practice69 lessonsReference images, inpainting, character LoRAs, upscaling, and the licence nobody read.
  5. Hugging Face, End to End75 lessonsRead a model card licence-first, run a Space for free, keep a token safe, publish something of your own.
  6. Editing Video77 lessonsCuts, sound, colour and export, taught on DaVinci Resolve, which costs nothing.
  7. Video with AI66 lessonsPlan the shots, generate ten takes, throw eight away, and cut what is left in a real editor.
  8. Motion, Sound and Music72 lessonsWhy nothing in the world starts at full speed, and why a blanket beats a better microphone.
  9. Making It Say Something64 lessonsClean work that communicates nothing is the commonest self-taught failure, and it is fixable.
  10. Working for Yourself84 lessonsSix portfolio pieces, twelve cold emails, a rate with arithmetic behind it, and a deposit before you start.