A thumbnail gives its camera a pixel it cannot see
Worth reading first: A pixel is not a point · The pixel that is not square.
A crop moves the frame and not the camera took a screenshot of a rendered window and cut a rectangle out of it, the rectangle given in the logical pixels an operating system speaks in. A crop scales nothing. It moves the frame’s corner and leaves the renderer’s camera where it was, so a cropped picture is exactly an off-centre camera’s picture, and the only thing the crop adds is the rounding of its edges to whole panel pixels: under half a pixel each way, cycling with the crop’s position.
A crop is rarely the end of the road. It is resized to fit something else: a thumbnail in a list, a figure in a document, an upload limited to a stated width. The tool doing it is given a width and keeps the aspect by computing the height, which comes out fractional and is rounded. The essay ended by asking what that costs. The resize scales the focal length by the target width over the crop’s width across, and by the rounded height over the crop’s height down, and those are two ratios of whole numbers that need not agree. How far apart do the picture’s two focal lengths end up? Is the disagreement bounded by one rounding in the target’s pixels, as every step taken by the true map has been, or does it grow when the target is small? And can a recovery reading the camera from a thumbnail tell the resize’s squeeze from a camera whose pixels were never square?
The disagreement is one rounding of the height, which grows relative to the picture as the picture shrinks. In pixels of focal length it can be several pixels. In the picture itself it moves nothing more than half a pixel. And no recovery from the picture’s own contents comes close to seeing it.
A width is given and a height is rounded
The window is the earlier one: 1280 by 720 logical pixels, a camera with a 60° vertical field, composited at a device scale of 1.5 onto a panel 1920 by 1080. The crop is 211 by 131 logical pixels, a shape chosen to match no common aspect, and lands on 316 by 196 panel pixels when each edge is rounded. Resized to 117 px wide, it should be 72.57 px tall and is 73.
The renderer’s focal length on the panel is the same in both directions, and the resize multiplies it by 117/316 across and by 73/196 down. The picture then has two focal lengths, 346.3 px and 348.4 px, 0.59% apart: it is the picture of a camera whose pixels are 1.0059 times as tall as they are wide. The resize also carries the principal point, by the true map that sends a pixel’s centre to a pixel’s centre, so the camera’s centre lands where the earlier essays found the true map always puts it, and the only thing new is the squeeze. The cropped part was already an off-centre camera, the one a tile is an off-centre frustum draws on purpose, and the resize keeps it one.
A rounded viewport has two focal lengths met the same arithmetic one step earlier in the pipeline. A renderer that takes its aspect from a window’s requested size and draws into a buffer of whole device pixels leaves two focal lengths that differ by up to a part in three hundred. That disagreement looked like it should grow on small screens and turned out to be a bounded displacement at the frame’s edge. The resize repeats its shape, but it puts the rounding somewhere the viewport could not: at the end of the pipeline, at a size chosen by whoever wanted the thumbnail, and after a crop that has already decided how much of the scene the picture holds.
One rounding of the height, filled
The rounded height is within half a pixel of the height the aspect asks for, so the two scales disagree by at most half a pixel over that height:
where is the unrounded target height and its rounding.
As the target width runs from 64 to 800 px the disagreement saws back and forth inside that envelope: 0.77% at 64 px wide, −0.24% at 320, never more than 0.81% at 100 px and 0.10% at 800. A tool that floors the height instead of rounding it, which is what integer division does, never makes the picture taller than its aspect, and its disagreement averages , as large as the rounded case’s worst and always in the direction that makes the pixel short.
That answers the first two questions in the relative sense, and the answer to the second is that it grows. A step by the true map is bounded by one rounding in its own pixels, and here the rounding is of the target’s height, so the smaller the target the larger the share of the picture the half pixel is.
Across 10,659 crop sizes resized to 320 px wide, the worst disagreement in each band of target heights reaches 99.9% of , so the bound is not a ceiling that the arithmetic rarely nears but the disagreement’s size. It is set by the target’s height alone. A strip resized to 320 px across, a panoramic slice of a game’s horizon or a toolbar, is a few dozen pixels tall and carries a disagreement of 1% or more. A tall crop at the same width carries a few hundredths. What the tool is asked for, a width, says nothing about which of those the picture will be.
Half a pixel of height is pixels of focal length
A relative disagreement is a percentage of the focal length, and the focal length of a crop is not a percentage of anything the crop shows.
Multiplying the relative bound by the focal length gives the gap in the target’s pixels: half a pixel times , the focal length measured in the picture’s own heights. That ratio does not depend on the target width at all, because resizing scales the focal length and the height together. It depends only on how much of the window the crop takes. A crop of 900 by 560 logical pixels, most of the window, has a focal length of about 1.2 of its heights and carries at most 0.6 px of focal gap at any target. The 211 by 131 crop, at 4.8 heights, carries up to 2.4 px. A crop of 61 by 47, a detail cut from the middle of the frame, has a focal length of more than thirteen of its own heights and carries up to 6.6 px: reached at 6.3 px across the widths tried.
So the second question has a second answer. In focal length, the disagreement is bounded by one rounding times the crop’s narrowness, which no choice of target can change. A thumbnail of a detail can carry a focal length several pixels different in its two directions, and the crop decided that before the resize was asked for.
The picture moves by half a pixel
What a reader of the picture cares about is not the focal length but where the picture puts things, and there the narrow crop’s six pixels vanish.
Measured against the crop as it landed on the panel, scaled by the width alone, the resize moves no corner or edge midpoint of the picture by more than 0.494 px, for any of the three crops at any target width. That is one rounding of a row: the bottom edge of the picture is where the rounded height puts it, which is within half a pixel of where the aspect would, and every other row is moved less. The six pixels of focal gap on the narrow crop are spread across thirteen heights of focal length, and over the picture’s own height they are half a pixel. A narrow field’s focal length is poorly pinned by its own picture for exactly that reason, and the resize spoils it only where nothing was pinned.
The whole error, against the camera the original request means, adds the crop’s own rounding. That is at most half a panel pixel at each edge, and the resize carries it at its own scale. In a thumbnail the scale is below one and the crop’s rounding shrinks; the 211 by 131 crop at 117 px wide is within 0.41 px everywhere. In an enlargement it grows. The 61 by 47 crop blown up to 800 px wide, 8.7 times its panel size, is 5.7 px wrong at its edge, almost all of it the crop’s half pixel on the panel magnified, and the resize’s own share is still under half a pixel. A rounding is bounded in the pixels it happens in, and an enlargement makes those pixels large.
So the second question’s full answer: the resize’s own rounding is bounded by half a pixel in the target, whatever the target’s size, as every true-map step has been. What grows is everything that happened before it, carried at the resize’s scale.
Can the thumbnail say it was squeezed?
The resized picture is exactly the picture of a camera with non-square pixels, of squeeze , and a principal point where the true map put it. Nothing in it can distinguish the two, because they are the same picture. The pixel that is not square found that a recovery has to be told the pixel’s shape, and a box leaves a line of cameras found why: a box’s three right angles are satisfied by a whole family of cameras of different squeezes. What closes the family is a fourth right angle the box does not contain, and a square closes the line of cameras supplied it from the diagonals of a square on one face.
So the third question is really whether that reading is fine enough to see a resize’s squeeze, and the answer turns on comparing two quantities that both depend on the thumbnail’s size.
Read to half a pixel in a picture 690 px wide, a box and a square give the squeeze back with a spread of 1.4%, against a worst resize of 0.12%. At 320 px the spread is 4.7% against 0.26%; at 160 px, 19% against 0.51%. Shrinking the thumbnail raises both, and raises the reading’s spread faster, because the vanishing points it rests on are found from lines whose pixels are getting large against their length. Read to a tenth of a pixel, which a careful edge fit on a sharp picture can reach, the reading’s spread falls to 0.24% at 690 px and 1.1% at 160 px: the two then shrink together, and the reading stays about twice as coarse as the worst squeeze it would need to see.
The answer is no, at every size, for one picture. A collection is different in one case. A rounded height errs as often one way as the other, so readings pooled over many thumbnails average its squeeze away along with their own scatter. A floored height errs one way only, by on average, and pooling does not remove a bias. If a hundred floored thumbnails 160 px wide were read to a tenth of a pixel and their readings were independent, the spread of their mean would fall by a factor of ten, to about 0.11%, under the 0.5% the flooring leaves. That is the arithmetic of pooling, not a measurement made here, and it needs a hundred pictures of boxes and squares that a tool made the same way, but it is the one route by which a resize’s squeeze could show up in the pictures themselves.
So for a single thumbnail the squeeze is invisible. The squeeze a resize gives a picture is real, it is up to a percent on a small thumbnail, and it is never as large as the uncertainty of reading it from the picture. A recovery from a thumbnail that is told the pixels are square is wrong by at most one rounding of the height, which is under its own error bars; told nothing, it cannot find out.
What a resized crop carries
Taken together, the pipeline from a renderer to a thumbnail has acquired three small things, and they are worth keeping apart because they come from different steps and behave differently.
The crop moves the principal point by its own rounding, under half a panel pixel, a point the centre of the picture is not the centre of the paper found any reader of a camera has to locate rather than assume, and a resize carries that at its scale. The resize squeezes the pixel by one rounding of the target’s height, at most , and moves the picture’s edge by under half a target pixel. And the focal length’s gap in pixels is that squeeze times the crop’s narrowness, which is the step where a detail cut from the middle of a frame pays more than a whole screenshot does.
None of them is visible in the picture, and only the last is large in pixels. For anyone reading a camera back from a resized crop, the practical rule is short. Take the focal length from the width, which the tool was asked for and did not round. Treat the height’s focal length as the width’s, which is wrong by at most one rounding and right to well within the reading’s own error. And if the picture has been enlarged, expect the crop’s own half pixel to come back at the enlargement’s scale, because the resize cannot know where it came from.
The window, the crop and the tool, as assumed
The resize uses the true map. A tool that multiplies coordinates by the scale instead moves the centre by of a new pixel, as halving a picture moves its centre found, and that offset is added to everything here without changing the squeeze.
The height is rounded or floored from the width. Some tools fit a picture inside a box and round whichever side is not given, and some round both from a scale factor. Every one of them rounds one or both sides once, and the bound is one rounding of whichever side was rounded; a tool that rounds both can disagree by the sum of two half-pixel shares.
The crop’s edges are rounded on the panel, the conversion the earlier essay found most common. A tool that converts the crop’s corner as though it were a pixel’s centre adds a further of a panel pixel, which an enlargement also carries.
The recovery reads a box and a square in a picture of the reading’s standard shape, 690 by 420, scaled down. A recovery from many boxes, or from a calibration target, reads the squeeze more finely, and one could in principle see a large thumbnail’s squeeze; one from a single box in a small thumbnail cannot.
Still open: whether a chain of resizes adds its roundings or forgets them
A picture on the web is rarely resized once. A crop becomes a figure at one width, the figure is placed in a page that scales it by a device’s ratio, and a second tool makes a preview card from the page. Each resize rounds a height, and the true-map steps on a display were found by a display’s scales cancel, if they are true maps to telescope: each rounding undone by the next scale, so that only the last survived. Those steps were all of the whole frame and all chosen to undo one another. A chain of thumbnails is chosen by people who do not know about each other’s roundings.
The measurement that settles what the chain does carries a crop through two and three resizes to stated widths, each rounding its own height, and asks whether the final squeeze is bounded by the last step’s rounding, as on a display, or by the sum of every step’s, and whether a chain that enlarges between two reductions brings the crop’s own half pixel back at the largest scale it passed through rather than the last.
A chain of resizes remembers its smallest picture takes that measurement: each tool keeps the aspect of the picture it was handed, so every rounding is kept, the squeeze is bounded by the sum of the steps’ roundings and dominated by the smallest picture’s, and the crop’s own half pixel comes back only at the final scale, since true maps compose.
A crop resized to a stated width, its height rounded, has two focal lengths that disagree by at most one rounding of that height, and across every crop size the disagreement fills the bound. In pixels of focal length that is half a pixel times the crop’s focal length in heights, so a narrow crop carries several; in the picture no edge moves more than half a pixel, and the crop’s own rounding is carried at the resize’s scale. A box and a square read the squeeze far more coarsely than any resize can spoil it, at every size of thumbnail.
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- A circle on the ground names the column and the focal length at once — both name focal length, identifiability, principal point
- A circle reads a tilted camera's column, and its tilt has to come from the verticals — both name focal length, identifiability, principal point
- A level picture shows its rise on its horizon, and hides its slide — both name focal length, identifiability, principal point
- A second rectangle fixes the column a level picture hides — both name focal length, identifiability, principal point
- Two circles leave the eye on a circle — both name focal length, identifiability, principal point
- A calibration through glass reports a prism — both name identifiability, principal point
Named objects
A flat tag is an object no other essay names yet.
Aspect ratioFocal lengthIdentifiabilityPrincipal pointQuantisation