How to Manage Images in PowerPoint

Multimedia elements form the integral structure of a PowerPoint presentation. Images, in particular, provide visual context and reinforce the information presented on each slide. Effective image management (whether inserting new visuals, updating existing ones, or cleaning up outdated graphics) is imperative for maintaining professional and scalable presentations.

This guide demonstrates how to work with images programmatically using IronPPT.

Get started with IronPPT

Start using IronPPT in your project today with a free trial.

First Step:
green arrow pointer


Add Image

To add an image in a PowerPoint document using IronPPT, create a new document object (or load from an existing file). Then, create an image object from the Image class that references a file. Once the image is loaded, add it to the document and specify the slide number where it should appear. From there, image attributes can be altered using properties such as Height, Width, and Angle. Finally, export the document with the newly added image.

:path=/static-assets/ppt/content-code-examples/how-to/manage-image-add-image-add-image.cs
using IronPPT;
using IronPPT.Models;

// Create a new presentation document
var document = new PresentationDocument();

// Create and load an image from file
Image image = new Image();
image.LoadFromFile("image.jpg");

// Add image to the first slide (index 0)
var newImage = document.AddImage(image, 0);

// Rotate the image 180 degrees
newImage.Angle = 180;

// Save the presentation as a .pptx file
document.Save("adding-image.pptx");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel
Add image to PowerPoint slide

Image Properties

Explore image property options in the table below.

Property Description Example
Height Sets the height of the image in points. image.Height = 300;
Width Sets the width of the image in points. image.Width = 400;
Angle Rotates the image by a specified angle in degrees. image.Angle = 45;
Position Sets the position of the image on the slide using x and y coordinates. image.Position = (200, 200);
FrameShape Sets the frame shape of the image using ShapeType enum values. image.FrameShape = IronPPT.Enums.ShapeType.RoundRectangle;

Modifying Added Image Properties

After adding an image to a slide, you can modify its properties to adjust appearance and positioning. E.g., using properties like Height, Width, and Angle to customize the image dimensions and rotation. Tweaking these settings lets you to fine-tune how the image appears in your presentation.

:path=/static-assets/ppt/content-code-examples/how-to/manage-image-add-image-modify-properties.cs
using IronPPT;
using IronPPT.Models;
using IronPPT.Enums;

// Load an existing presentation document
var document = new PresentationDocument("existing-presentation.pptx");

// Create and load an image from file
Image image = new Image();
image.LoadFromFile("image.jpg");

// Add image to the second slide (index 1)
var newImage = document.AddImage(image, 1);

// Modify image properties
newImage.Angle = 45; // Rotate the image 45 degrees
newImage.FrameShape = ShapeType.RoundRectangle; // Set the frame shape to Rounded Rectangle
newImage.Position = (180, 180); // Set the position to coordinates (180, 180)
newImage.Width = 300; // Set the width to 300 points
newImage.Height = 300; // Set the height to 300 points

// Save the modified presentation as a new .pptx file
document.Save("modifying-image-properties.pptx");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel
Modify image properties in PowerPoint

Replace Image

Replacing an image is an intuitive task with IronPPT. First, load the presentation document and your new image into a fresh Image object. Then, target the image you wish to update by selecting its slide and index, such as Slides[0].Images[0] (for the first image on the first slide). Once complete, call the Replace method using the new image object and export the file.

:path=/static-assets/ppt/content-code-examples/how-to/manage-image-replace-image-replace-image.cs
using IronPPT;
using IronPPT.Models;

// Load an existing presentation
var document = new PresentationDocument("sample.pptx");

// Load the replacement image
Image replaceImage = new Image();
replaceImage.LoadFromFile("sample.png");

// Replace the first image found in the first slide
document.Slides[0].Images[0].Replace(replaceImage);

// Save changes (overwriting the original file)
document.Save("sample.pptx");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Original

Replace image on a PowerPoint slide (Before replacement)

Result

Replace image on a PowerPoint slide (After replacement)

Remove Image by Index

The simplest way to remove an image is by its index position. Access the slide's image collection and use the Remove method with the zero-based index of the image you want to delete. This approach works well when you know the exact position of the image in the collection.

:path=/static-assets/ppt/content-code-examples/how-to/manage-image-remove-image-remove-by-index.cs
using IronPPT;

// Create a new presentation
var document = new PresentationDocument("real_sample.pptx");

// Remove the first image found in the first slide
document.Slides[1].Images[0].Remove();

// Save the updated presentation
document.Save("removed-image.pptx");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Before Image Removal

Remove image by index from PowerPoint slide (before view)

After Image Removal

Remove image by index from PowerPoint slide (after view)

Removing All Images

For scenarios where there needs to be a bulk deletion for all of the Image files in a document, we can use two for loops: once to iterate through all document pages, and twice to reiterate through and remove all the identified images per page. An example is shown below.

:path=/static-assets/ppt/content-code-examples/how-to/manage-image-remove-all-images.cs
using IronPPT;
using IronPPT.Models;

// Load an existing presentation
var document = new PresentationDocument("real_sample.pptx");

// Remove all images from every slide
for (int s = 0; s < document.Slides.Count; s++)       // Loop through all slides
{
    var slide = document.Slides[s];                   // Get the current slide

    for (int i = slide.Images.Count - 1; i >= 0; i--) // Loop backward through images on this slide
    {
        slide.Images[i].Remove();                     // Remove each image
    }
}

// Save the updated presentation
document.Save("removed-images.pptx");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Before Bulk Deletion

Remove image by index from PowerPoint slide in bulk (before view)

After Bulk Deletion

As you can see, all the images are removed from slides 2 and 4.

Remove image by index from PowerPoint slide in bulk (after view)

Frequently Asked Questions

How can I add images to PowerPoint slides using IronPPT?

With IronPPT, you can add images to your PowerPoint slides by utilizing its intuitive API to insert images at specific locations on any slide.

What is the process for removing images in PowerPoint with IronPPT?

IronPPT allows you to remove images from PowerPoint slides by identifying the image object and using the appropriate API calls to delete it from the presentation.

Can I replace an existing image in a PowerPoint presentation using IronPPT?

Yes, IronPPT provides the functionality to replace existing images by removing the old image and adding a new one in its place, ensuring your presentation remains up-to-date.

Does IronPPT support managing multiple images on a single slide?

IronPPT supports managing multiple images on a single slide, allowing you to add, remove, or replace images as needed to customize your presentation.

What image formats are supported by IronPPT for PowerPoint slides?

IronPPT supports various image formats, including JPEG, PNG, and BMP, enabling you to work with a wide range of image types for your PowerPoint presentations.

Is it possible to resize images in PowerPoint using IronPPT?

Yes, IronPPT provides functionality to resize images, allowing you to adjust image dimensions to fit your slide layout perfectly.

How does IronPPT handle image transparency in PowerPoint slides?

IronPPT supports image transparency, allowing you to incorporate images with transparent backgrounds seamlessly into your PowerPoint presentations.

Can IronPPT be used to manage images in batch processing for PowerPoint presentations?

IronPPT is capable of handling batch processing, enabling you to manage multiple images across several slides efficiently.

Ahmad Sohail
Full Stack Developer

Ahmad is a full-stack developer with a strong foundation in C#, Python, and web technologies. He has a deep interest in building scalable software solutions and enjoys exploring how design and functionality meet in real-world applications.

Before joining the Iron Software team, Ahmad worked on automation projects ...

Read More
Ready to Get Started?
Nuget Downloads 3,211 | Version: 2025.11 just released