Save image selection into a (different) folder(s)

Hi, I am new in Processing and I have this project that someone has to make an image selection then the selection has to be saved in a specific folder so that when the archive is running again that can save the new selection into a new folder.
Actually, my project has 17 images to be load and chosen by the user but I have put here only 7 so could be easier to view. Someone has a tip what should I do? Should I remake the saving code below?

PImage [] fotos = new PImage[7];
int index = 0;
Names[] name = new Names[fotos.length];

void setup() {
  size (400,400);
  fotos[0] = loadImage("carta0.png");
  fotos[1] = loadImage("carta1.png");
  fotos[2] = loadImage("carta2.png");
  fotos[3] = loadImage("carta3.png");
  fotos[4] = loadImage("carta4.png");
  fotos[5] = loadImage("carta5.png");
  fotos[6] = loadImage("carta6.png");
  for (int i = 0; i < fotos.length; i++) {
    name[i] = new Names(fotos[i]);

void draw() {

void mousePressed() {
  index = int(random(0, fotos.length));

void keyPressed() {

  if (key == CODED) {
    if (keyCode == UP) {
    } else if (keyCode == DOWN) {
    } else if (keyCode == LEFT) {
   else if (keyCode == RIGHT) {
class Names{
 PImage img;
 Names(PImage tempImg){
   img = tempImg;
 void display(){
1 Like

In my opinion you should display the images on screen

My idea:

In the corner of each image there is a small rectangle (make it part of function display () using the variable selected, see below)

When clicking the mouse on an image this rect gets a cross - image is selected (make selected part of your class)

When it was already selected, unselect it

The user has now time to select and unselect. Nothing is saved yet

On key return (or with a further screen button SAVE for the mouse) for loop over the images and save when selected is true