What is the optimal format to read some layer information?

in particular, I want to read the layer information sort of like this way:

 vector<individual_image_layer> image_with_layers;
  for (int i = 0; i < image_with_layers.size();++i){
     auto& layer_i  = image_with_layers[i];
     // read pixel from a layer : layer_i[...][...];

is there any library for this kind of operation?

should i use .aseprite? or is there any other options?

I can’t answer this for you, but just know that this topic is set to Development, and should instead be set to Scripts and Extentions.

Having it set there will make it a lot easier for people to find this and help you.