Converting PowerPoint Slides to PNG and JPG on Linux
Converting PPTX presentations to image files on Linux requires a two-step process: first convert to PDF, then rasterize to your target image format. This approach preserves slide layout and fonts better than direct conversion tools.
Convert PPTX to PDF
Start by converting your PowerPoint file to PDF using LibreOffice:
libreoffice --headless --convert-to pdf presentation.pptx
The --headless flag runs LibreOffice in batch mode without launching the GUI, making it suitable for scripts and automation. The output file will be named presentation.pdf.
If you need to specify an output directory:
libreoffice --headless --convert-to pdf --outdir /path/to/output presentation.pptx
Convert PDF to Image Files
Once you have a PDF, use ImageMagick’s convert command to rasterize each page as a separate image:
convert -density 400 -resize 3000 presentation.pdf presentation-%d.jpg
Key parameters:
-density 400: Sets the DPI for rendering. Higher values produce sharper images but larger file sizes. Use 150-200 for web, 300+ for print quality.-resize 3000: Specifies the width in pixels. The height scales proportionally to maintain aspect ratio.presentation-%d.jpg: Output pattern where%dis replaced with the slide number (0-indexed).
For PNG output with transparency:
convert -density 300 -background white presentation.pdf presentation-%d.png
Adding -background white ensures transparent areas are filled with white rather than remaining transparent.
Modern Alternative: Using GraphicsMagick
For better performance with large presentations, use GraphicsMagick, which is faster than ImageMagick:
gm convert -density 300 presentation.pdf presentation-%d.jpg
The syntax is identical, but GraphicsMagick handles batch operations more efficiently.
Complete Automated Script
Create a reusable script for batch conversions:
#!/bin/bash
if [ $# -lt 2 ]; then
echo "Usage: $0 <input.pptx> <output_format> [density] [width]"
echo "Formats: jpg, png"
exit 1
fi
input_file="$1"
format="$2"
density="${3:-300}"
width="${4:-2000}"
base_name="${input_file%.*}"
# Convert PPTX to PDF
libreoffice --headless --convert-to pdf "$input_file" 2>/dev/null
# Convert PDF to images
if [ "$format" = "png" ]; then
convert -density "$density" -background white -resize "$width" \
"$base_name.pdf" "$base_name-%d.png"
else
convert -density "$density" -resize "$width" \
"$base_name.pdf" "$base_name-%d.jpg"
fi
echo "Conversion complete: $base_name-*.${format}"
Usage:
chmod +x convert_pptx.sh
./convert_pptx.sh presentation.pptx jpg 300 2000
Troubleshooting
Missing dependencies: Install required packages:
# Debian/Ubuntu
sudo apt install libreoffice imagemagick
# RHEL/CentOS
sudo dnf install libreoffice ImageMagick
ImageMagick policy restrictions: If convert fails with a policy error, you may need to edit /etc/ImageMagick-6/policy.xml to allow PDF operations. Look for the PDF policy block and change rights="none" to rights="read|write".
Large file sizes: Reduce quality to lower file size:
convert -density 150 -quality 85 presentation.pdf presentation-%d.jpg
Memory issues with large presentations: Process one slide at a time:
pdfseparate presentation.pdf page-%d.pdf
for i in page-*.pdf; do
convert -density 300 "$i" "${i%.pdf}.jpg"
done
This approach is more memory-efficient for presentations with 50+ slides.
2026 Best Practices and Advanced Techniques
For Converting PowerPoint Slides to PNG and JPG on Linux, understanding both the fundamentals and modern practices ensures you can work efficiently and avoid common pitfalls. This guide extends the core article with practical advice for 2026 workflows.
Troubleshooting and Debugging
When issues arise, a systematic approach saves time. Start by checking logs for error messages or warnings. Test individual components in isolation before integrating them. Use verbose modes and debug flags to gather more information when standard output is not enough to diagnose the problem.
Performance Optimization
- Monitor system resources to identify bottlenecks
- Use caching strategies to reduce redundant computation
- Keep software updated for security patches and performance improvements
- Profile code before applying optimizations
- Use connection pooling and keep-alive for network operations
Security Considerations
Security should be built into workflows from the start. Use strong authentication methods, encrypt sensitive data in transit, and follow the principle of least privilege for access controls. Regular security audits and penetration testing help maintain system integrity.
Related Tools and Commands
These complementary tools expand your capabilities:
- Monitoring: top, htop, iotop, vmstat for system resources
- Networking: ping, traceroute, ss, tcpdump for connectivity
- Files: find, locate, fd for searching; rsync for syncing
- Logs: journalctl, dmesg, tail -f for real-time monitoring
- Testing: curl for HTTP requests, nc for ports, openssl for crypto
Integration with Modern Workflows
Consider automation and containerization for consistency across environments. Infrastructure as code tools enable reproducible deployments. CI/CD pipelines automate testing and deployment, reducing human error and speeding up delivery cycles.
Quick Reference
This extended guide covers the topic beyond the original article scope. For specialized needs, refer to official documentation or community resources. Practice in test environments before production deployment.

Thanks, Mr. Ma! That worked perfectly on a headless Raspberry Pi. For people who only want to run this from command line, I highly recommend `apt install libreoffice-nogui` which saved a lot of storage space.
Also, I was able to use `pdfimages -all file.pdf file` to extract the embedded images from the slides, which was all that I needed. It operates instantly, as opposed to `convert` which is slow, but isn’t generally useful since it doesn’t actually draw the slides. (It’ll be missing text, for example.)