---
Product: Aspose.Slides
Platform: java
Page Type: reference
Canonical URL: https://reference.aspose.org/slides/java/ImageCollection
---

# ImageCollection

## Overview

`ImageCollection` is a class in Aspose.Slides FOSS for Java.
Inherits from: `IImageCollection`.

Represents a collection of images in a presentation.

This class provides 12 methods for working with ImageCollection objects in Java programs.
Available methods include: `ImageCollection`, `addImage`, `asICollection`, `asIEnumerable`, `findNextImageNumber`, `get`, `initInternal`, `iterator`, `size`.
All public members are accessible to any Java application after installing the Aspose.Slides FOSS for Java package.

## Methods

| Signature | Description |
|-----------|-------------|
| `ImageCollection(pkg: OpcPackage)` | Creates an image collection backed by the given OPC package. |
| `ImageCollection()` | Creates an uninitialized image collection. |
| `initInternal(opcPackage: OpcPackage)` | Internal initialization — scans the package for all images in {@code ppt/media/}. |
| `addImage(image: IImage)` → `IPPImage` | Adds image data from an InputStream and returns the stored IPPImage |
| `addImage(imageData: byte[])` → `IPPImage` |  |
| `addImage(stream: InputStream)` → `IPPImage` |  |
| `get(index: int)` → `IPPImage` | Returns the IPPImage at the specified index |
| `size()` → `int` |  |
| `asICollection()` → `List` | Returns a List view of the IPPImage items |
| `asIEnumerable()` → `Iterable` | Returns an Iterable view of the IPPImage items |
| `iterator()` → `Iterator` | Returns an Iterator over the IPPImage items |
| `findNextImageNumber()` → `int` | Finds the next available image number in {@code ppt/media/}. |

## See Also

- [Aspose.Slides — Enterprise API Reference](https://reference.aspose.com/slides/)