Why does resizing photos use so much memory?

A photo can be small enough to email and still need much more room while your browser resizes it. The browser has to unpack its pixels—and may need several working copies at once.

Why doesn't a photo's file size show its memory use?

Think of a JPEG as a folded paper map: it travels small, but you have to open it to work with it. Your browser unpacks the picture into a grid with a value for every pixel. Resizing works on that grid, so a small file doesn't mean a small memory bill.

Take a 24-megapixel JPEG: unpacking its pixels takes about 13 times the space of the file. For your own photo, width × height × 4 bytes gives the space for one grid like this.

The same generated image as a compact JPEG and an expanded pixel grid, with a magnified patch of real pixels.

JPEG file and pixel grid

The picture stays the same; the space needed to hold it changes. This is one grid, before any extra working copies. How we reviewed

Why can resizing need several working copies?

The browser may hold the full-size picture while it draws a smaller version on a canvas—a blank sheet it can paint on. Reading pixels back from that canvas can create another working copy before the output file is packed.

A JPEG expands into source pixels, is drawn onto a resizing canvas, is read back for encoding, and becomes an output file. The three middle pixel copies can coexist.

Possible working copies

Possible working copies during a resize, drawn as a schematic. Their lifetimes can overlap.

That's why a smaller finished photo can still need plenty of room while it's being made. The output dimensions describe the result; the browser also has to handle the picture you started with.

How does FluffyBench help with resizing memory?

FluffyBench's Image Space Saver gives the browser a heads-up that it will read pixels back from the resizing canvas, so the browser can prepare for that work.

After the canvas change, average memory growth in Firefox's graphics process—the part that draws pictures—fell from about 104.1 to 1.3 MiB per photo in our recorded runs.

Scale: 120 MiB/photo

Before the change, run 1
104.6 MiB/photo
Before the change, run 2
103.8 MiB/photo
Before the change, run 3
103.9 MiB/photo
After the change, run 1
1.71 MiB/photo
After the change, run 2
0.97 MiB/photo
0 MiB/photo30 MiB/photo60 MiB/photo90 MiB/photo120 MiB/photo
  1. Before the change

    All three earlier runs show much larger growth.

  2. After the change

    Both later runs stay near the bottom of the same scale.

Memory growth per photo, three runs before the canvas change and two after.

Doing it in FluffyBench: resizing a photo batch

The canvas hint is already automatic in FluffyBench's Image Space Saver. If your computer struggles with a batch, Batch speed: Light limits how many photos can be worked on at once. On phones, the tool already limits parallel work and hides that control.

Choose your photos, set their output bounds and choose Light if memory is tight. These screenshots leave the default Auto Balanced profile in place.

  1. Choose the photos you want to resize.
    Choose the photos you want to resize.
    Step 1. Choose the photos you want to resize.
    1. Choose images opens your file picker.
  2. Open Settings (the gear) to choose output dimensions.
    Open Settings (the gear) to choose output dimensions.
    Step 2. Open Settings (the gear) to choose output dimensions.
    1. Settings opens the image controls.
  3. Use your destination's pixel bounds; here they're 960 x 640.
    Use your destination's pixel bounds; here they're 960 x 640.
    Step 3. Use your destination's pixel bounds; here they're 960 x 640.
    1. Dimensions opens the pixel bounds.
    2. Width sets the horizontal bound.
    3. Height sets the vertical bound.
  4. Batch speed set to Light.
    Batch speed set to Light.
    Step 4. On a computer short of memory, choose Batch speed: Light.
    1. Light caps the number of photos worked on at once.
    2. Fast allows more parallel work and can use more memory.
  5. Close Settings after choosing the dimensions and batch speed.
    Close Settings after choosing the dimensions and batch speed.
    Step 5. Close Settings after choosing the dimensions and batch speed.
    1. Settings closes the controls in this narrow layout.

With the dimensions set, you're ready to make and save the smaller copies.

  1. Process the two photos with the chosen dimensions.
    Process the two photos with the chosen dimensions.
    Step 1. Process the two photos with the chosen dimensions.
    1. Process 2 images applies your settings.
  2. Check the finished dimensions and file size, then Download a copy.
    Check the finished dimensions and file size, then Download a copy.
    Step 2. Check the finished dimensions and file size, then Download a copy.
    1. Compare the finished dimensions with your destination's limits.
    2. Download saves this finished image.
  3. For the whole batch, use Download all (ZIP).
    For the whole batch, use Download all (ZIP).
    Step 3. For the whole batch, use Download all (ZIP).
    1. Download all (ZIP) saves both finished images together.

If a large image still runs into a browser limit, our guide to very large images in a browser explains where time and memory go.

Need to reduce image dimensions before conversion?

Search FluffyBench