# How to export frames as layers to an ico file

**URL:** https://discourse.processing.org/t/how-to-export-frames-as-layers-to-an-ico-file/35448
**Category:** Coding Questions
**Created:** [February 25, 2022, 7:57pm UTC](https://discourse.processing.org/t/how-to-export-frames-as-layers-to-an-ico-file/35448 "2022-02-25T19:57:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Fred-Sheppard](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fred-sheppard/32/15796_2.png) [@Fred-Sheppard](https://discourse.processing.org/u/Fred-Sheppard)
#### Post date: [February 25, 2022, 7:57pm UTC](https://discourse.processing.org/t/how-to-export-frames-as-layers-to-an-ico-file/35448/1 "2022-02-25T19:57:54Z")

</div>

I want to be able to export the processing window across several frames, using saveFrames() or similar, to a single ico file with one layer per frame. It might work similar to the code shown.

```auto
PImage img;

void setup() {
  size(400, 200);
  surface.setResizable(true);
  imageMode(CENTER);
  img = loadImage("icon.png");
  int size = 192;
  saveImage(size); //Layer 1
  size = 144;
  saveImage(size); //Layer 2
  size = 96;
  saveImage(size); //Layer 3
  size = 72;
  saveImage(size); //Layer 4
  size = 48;
  saveImage(size); //Layer 5
  size = 36;
  saveImage(size); //Layer 6
  exit();
}

void draw() {
}

void saveImage(int size) {
  img.resize(size, size);
  surface.setSize(size, size);
  background(150);
  image(img, width/2, height/2);
  save("icon-" +size +".png"); //This function would change
}

```

Is there any function or library for performing such a task?
