# Skill 054

> Manage and optimize images within PowerPoint presentations. This skill focuses on image insertion, formatting, and compression within .pptx files.

- Skill: `legendtkl/skill-054` (Agent Skill)
- Install (CLI): `npx skillmds@latest add legendtkl/skill-054`
- Raw SKILL.md: https://api.skillmd.com/api/skills/legendtkl/skill-054/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- License: Proprietary. LICENSE.txt has complete terms
- Author: legendtkl (https://skillmd.com/u/legendtkl)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/legendtkl/skill-054

---


# PPTX Image Management

## Overview
Managing images in PowerPoint presentations can enhance the visual appeal and overall effectiveness of your slides. This skill provides methods to insert, format, and optimize images within .pptx files.

## Inserting Images
### Basic Insertion
You can insert images into your PowerPoint slides using the following method:

```python
from pptx import Presentation
from pptx.util import Inches

# Load the presentation
prs = Presentation('path-to-file.pptx')

# Adding a new slide
slide_layout = prs.slide_layouts[5]  # Using a blank layout
slide = prs.slides.add_slide(slide_layout)

# Specify the image file
img_path = 'path-to-image.jpg'

# Insert image
left = Inches(1)
 top = Inches(1)
 slide.shapes.add_picture(img_path, left, top)

# Save the presentation
prs.save('updated-presentation.pptx')
```

### Advanced Insertion with Formatting
To maintain uniformity, you may want to format images after insertion:

```python
from pptx.dml.color import RGBColor

# Set formatting options
picture = slide.shapes[-1]  # Get the last inserted picture
picture.width = Inches(5)
picture.height = Inches(3)

# Set the border
border = picture.line
border.color.rgb = RGBColor(255, 255, 255)  # White border
border.width = Inches(0.05)
```

## Optimizing Images
Images can take up a significant amount of space in a presentation. It's often beneficial to compress images to reduce the overall file size:

### Compressing Images
You can utilize the following method to compress images within a PowerPoint presentation:

```python
def compress_images(prs):
    for slide in prs.slides:
        for shape in slide.shapes:
            if shape.shape_type == 13:  # Check if the shape is a picture
                shape.image.compress(quality=50)

# Load the presentation
prs = Presentation('path-to-file.pptx')
compress_images(prs)
prs.save('compressed-presentation.pptx')
```

## Conclusion
Image management is essential for creating effective PowerPoint presentations. By inserting and optimizing images, you can enhance user engagement and presentation clarity.
