<!-- canonical: efficientnewlanguage.org/ai/examples/894-the-thumbnail-skipped-every-other-pixel | ai_layer_version: 0.1.0 | updated: 2026-09-17 -->

# Example 894 — The thumbnail skipped every other pixel

`the_thumbnail_skipped_every_other_pixel.eml` - A thumbnailer halves an image by taking every other pixel in each direction, and it takes exactly the pixels it says it takes, over the whole image. What a picture of fine lines becomes when every other pixel is taken is computed below.

## EML

```eml
# Self-authored for the EML case corpus (no external origin). A thumbnailer
# halves an image by taking every other pixel in each direction, and it takes
# exactly the pixels it says it takes, over the whole image. What a picture of
# fine lines becomes when every other pixel is taken is computed below.
#
# The resize is careful. It reads the real source pixels, not a cached copy; it
# uses the engine's own nearest-neighbour sampler over every output pixel; the
# output is exactly half the width and height; and the intent is exactly 'a
# smaller picture of the same image'.
#
# The source is a grid of one-pixel black lines every two pixels, and taking
# every other pixel lands on the lines every time, so the thumbnail is solid
# black - or solid white, had the sampler started one pixel over.

5000 => source_black_share_per_myriad
2 => line_spacing_pixels
2 => sampling_step_pixels
10000 => thumbnail_black_share_nearest_per_myriad
5000 => thumbnail_black_share_box_filter_per_myriad

thumbnail_black_share_nearest_per_myriad - source_black_share_per_myriad => darkness_error_per_myriad
thumbnail_black_share_box_filter_per_myriad - source_black_share_per_myriad => darkness_error_box_filter

"source, share of black          : " + str(source_black_share_per_myriad) + " per ten thousand" ^0
"line spacing                    : every " + str(line_spacing_pixels) + " pixels" ^0
"sampling step                   : every " + str(sampling_step_pixels) + " pixels" ^0
"" ^0
"thumbnail black, nearest sample : " + str(thumbnail_black_share_nearest_per_myriad) + " per ten thousand" ^0
"thumbnail black, box filter     : " + str(thumbnail_black_share_box_filter_per_myriad) + " per ten thousand" ^0
"darkness error, nearest         : " + str(darkness_error_per_myriad) + " per ten thousand" ^0
"darkness error, box filter      : " + str(darkness_error_box_filter) ^0
"" ^0

# ---- what the resize verified ----

"the thumbnailer" ^0
"  reads : the real source pixels" ^0
"  sampler : the engine's own nearest-neighbour, every output" ^0
"    pixel" ^0
"  size : exactly half the width and height" ^0
"  intent : a smaller picture of the same image" ^0
"  output pixels not sampled from the source : 0" ^0
"  verdict : EVERY THUMBNAIL PIXEL IS A REAL SOURCE PIXEL" ^0
"" ^0
"  taking a real source pixel for every output pixel is the" ^0
"  part done right here, and it is why nothing in the" ^0
"  thumbnail was invented" ^0
"" ^0

# ---- what every-other-pixel does to fine lines ----

"sampling below the pattern" ^0
"  the pattern repeats : every " + str(line_spacing_pixels) + " pixels" ^0
"  the sampler visits : every " + str(sampling_step_pixels) + " pixels" ^0
"  so the sampler sees : the same phase of the pattern each" ^0
"    time - always a line, or never a line" ^0
"  the thumbnail : solid black, " + str(thumbnail_black_share_nearest_per_myriad) + " per ten thousand" ^0
"  one pixel over : solid white, 0 per ten thousand" ^0
"  what half the pixels being black became : all, or none" ^0
"" ^0

# ---- what the viewer sees ----

"the thumbnail" ^0
"  intended : a small grey-looking grid" ^0
"  rendered : a black square" ^0
"  is any pixel invented : no; every one is a real source" ^0
"    pixel" ^0
"  is a real pixel a representative pixel : no; which real" ^0
"    pixels were taken is the whole picture" ^0
"" ^0

# ---- null control ----

# The same resize with a box filter: each output pixel is the mean of the source
# pixels it covers, not one of them.
10000 => nc_black_share_nearest
5000 => nc_black_share_box_filter
0 => nc_darkness_error_box_filter

"null control - average the covered pixels instead of picking one" ^0
"  black share, nearest sample : " + str(nc_black_share_nearest) + " per ten thousand" ^0
"  black share, box filter : " + str(nc_black_share_box_filter) + " per ten thousand" ^0
"  darkness error, box filter : " + str(nc_darkness_error_box_filter) ^0
"  no source pixel changed; the thumbnail stopped being a" ^0
"  sample and started being a summary" ^0
"" ^0

# ---- the rule ----

"what an every-other-pixel thumbnail guarantees" ^0
"  every output pixel is a real source pixel : exactly, the" ^0
"    engine's own sampler over the whole image" ^0
"  the output looks like the source : not addressed; the" ^0
"    lines repeat every " + str(line_spacing_pixels) + " pixels and the sampler steps every " + str(sampling_step_pixels) + "," ^0
"    so it lands on the same phase every time - " + str(thumbnail_black_share_nearest_per_myriad) + " per ten" ^0
"    thousand black from a source that is " + str(source_black_share_per_myriad) ^0
"" ^0

"a sample taken at the rhythm of the pattern sees one beat of it forever; what" ^0
"looks like a fair pick of pixels is a fixed phase, and the picture it makes is" ^0
"the pattern's phase, not the pattern" ^0
"" ^0

"It takes a real source pixel for every output pixel - nothing is invented. But" ^0
"the lines repeat every " + str(line_spacing_pixels) + " pixels and the sampler steps every " + str(sampling_step_pixels) + ", so it lands" ^0
"on a line every time; the thumbnail is " + str(thumbnail_black_share_nearest_per_myriad) + " per ten thousand black from a source" ^0
"that is " + str(source_black_share_per_myriad) + ", until the covered pixels are averaged instead of picked." ^0
```

## Python (deterministic transpilation)

```python
source_black_share_per_myriad = 5000
line_spacing_pixels = 2
sampling_step_pixels = 2
thumbnail_black_share_nearest_per_myriad = 10000
thumbnail_black_share_box_filter_per_myriad = 5000
darkness_error_per_myriad = thumbnail_black_share_nearest_per_myriad - source_black_share_per_myriad
darkness_error_box_filter = thumbnail_black_share_box_filter_per_myriad - source_black_share_per_myriad
print("source, share of black          : " + str(source_black_share_per_myriad) + " per ten thousand")
print("line spacing                    : every " + str(line_spacing_pixels) + " pixels")
print("sampling step                   : every " + str(sampling_step_pixels) + " pixels")
print("")
print("thumbnail black, nearest sample : " + str(thumbnail_black_share_nearest_per_myriad) + " per ten thousand")
print("thumbnail black, box filter     : " + str(thumbnail_black_share_box_filter_per_myriad) + " per ten thousand")
print("darkness error, nearest         : " + str(darkness_error_per_myriad) + " per ten thousand")
print("darkness error, box filter      : " + str(darkness_error_box_filter))
print("")
print("the thumbnailer")
print("  reads : the real source pixels")
print("  sampler : the engine's own nearest-neighbour, every output")
print("    pixel")
print("  size : exactly half the width and height")
print("  intent : a smaller picture of the same image")
print("  output pixels not sampled from the source : 0")
print("  verdict : EVERY THUMBNAIL PIXEL IS A REAL SOURCE PIXEL")
print("")
print("  taking a real source pixel for every output pixel is the")
print("  part done right here, and it is why nothing in the")
print("  thumbnail was invented")
print("")
print("sampling below the pattern")
print("  the pattern repeats : every " + str(line_spacing_pixels) + " pixels")
print("  the sampler visits : every " + str(sampling_step_pixels) + " pixels")
print("  so the sampler sees : the same phase of the pattern each")
print("    time - always a line, or never a line")
print("  the thumbnail : solid black, " + str(thumbnail_black_share_nearest_per_myriad) + " per ten thousand")
print("  one pixel over : solid white, 0 per ten thousand")
print("  what half the pixels being black became : all, or none")
print("")
print("the thumbnail")
print("  intended : a small grey-looking grid")
print("  rendered : a black square")
print("  is any pixel invented : no; every one is a real source")
print("    pixel")
print("  is a real pixel a representative pixel : no; which real")
print("    pixels were taken is the whole picture")
print("")
nc_black_share_nearest = 10000
nc_black_share_box_filter = 5000
nc_darkness_error_box_filter = 0
print("null control - average the covered pixels instead of picking one")
print("  black share, nearest sample : " + str(nc_black_share_nearest) + " per ten thousand")
print("  black share, box filter : " + str(nc_black_share_box_filter) + " per ten thousand")
print("  darkness error, box filter : " + str(nc_darkness_error_box_filter))
print("  no source pixel changed; the thumbnail stopped being a")
print("  sample and started being a summary")
print("")
print("what an every-other-pixel thumbnail guarantees")
print("  every output pixel is a real source pixel : exactly, the")
print("    engine's own sampler over the whole image")
print("  the output looks like the source : not addressed; the")
print("    lines repeat every " + str(line_spacing_pixels) + " pixels and the sampler steps every " + str(sampling_step_pixels) + ",")
print("    so it lands on the same phase every time - " + str(thumbnail_black_share_nearest_per_myriad) + " per ten")
print("    thousand black from a source that is " + str(source_black_share_per_myriad))
print("")
print("a sample taken at the rhythm of the pattern sees one beat of it forever; what")
print("looks like a fair pick of pixels is a fixed phase, and the picture it makes is")
print("the pattern's phase, not the pattern")
print("")
print("It takes a real source pixel for every output pixel - nothing is invented. But")
print("the lines repeat every " + str(line_spacing_pixels) + " pixels and the sampler steps every " + str(sampling_step_pixels) + ", so it lands")
print("on a line every time; the thumbnail is " + str(thumbnail_black_share_nearest_per_myriad) + " per ten thousand black from a source")
print("that is " + str(source_black_share_per_myriad) + ", until the covered pixels are averaged instead of picked.")
```

## stdout (executed)

```text
source, share of black          : 5000 per ten thousand
line spacing                    : every 2 pixels
sampling step                   : every 2 pixels

thumbnail black, nearest sample : 10000 per ten thousand
thumbnail black, box filter     : 5000 per ten thousand
darkness error, nearest         : 5000 per ten thousand
darkness error, box filter      : 0

the thumbnailer
  reads : the real source pixels
  sampler : the engine's own nearest-neighbour, every output
    pixel
  size : exactly half the width and height
  intent : a smaller picture of the same image
  output pixels not sampled from the source : 0
  verdict : EVERY THUMBNAIL PIXEL IS A REAL SOURCE PIXEL

  taking a real source pixel for every output pixel is the
  part done right here, and it is why nothing in the
  thumbnail was invented

sampling below the pattern
  the pattern repeats : every 2 pixels
  the sampler visits : every 2 pixels
  so the sampler sees : the same phase of the pattern each
    time - always a line, or never a line
  the thumbnail : solid black, 10000 per ten thousand
  one pixel over : solid white, 0 per ten thousand
  what half the pixels being black became : all, or none

the thumbnail
  intended : a small grey-looking grid
  rendered : a black square
  is any pixel invented : no; every one is a real source
    pixel
  is a real pixel a representative pixel : no; which real
    pixels were taken is the whole picture

null control - average the covered pixels instead of picking one
  black share, nearest sample : 10000 per ten thousand
  black share, box filter : 5000 per ten thousand
  darkness error, box filter : 0
  no source pixel changed; the thumbnail stopped being a
  sample and started being a summary

what an every-other-pixel thumbnail guarantees
  every output pixel is a real source pixel : exactly, the
    engine's own sampler over the whole image
  the output looks like the source : not addressed; the
    lines repeat every 2 pixels and the sampler steps every 2,
    so it lands on the same phase every time - 10000 per ten
    thousand black from a source that is 5000

a sample taken at the rhythm of the pattern sees one beat of it forever; what
looks like a fair pick of pixels is a fixed phase, and the picture it makes is
the pattern's phase, not the pattern

It takes a real source pixel for every output pixel - nothing is invented. But
the lines repeat every 2 pixels and the sampler steps every 2, so it lands
on a line every time; the thumbnail is 10000 per ten thousand black from a source
that is 5000, until the covered pixels are averaged instead of picked.
```

## Round-trip

`ok: true` — round-trip fixpoint reached (python1 == python2)

## Trace event types

eml:run:start · eml:assign · eml:output · eml:run:done
