
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
imageconvert
Advanced tools
A Python library for converting between different image formats with metadata preservation
ImageConvert is a robust Python library designed for seamless conversion between modern image formats and PDFs. Unlike basic converters, it prioritizes data integrity—preserving EXIF metadata, GPS coordinates, and original file timestamps during the process.
For a complete guide on all classes, methods, and parameters, please see the API Reference.
Explore the complete documentation and examples here:
👉 https://ricardos-projects.gitbook.io/imageconvert-docs
pip install imageconvert
Note: This automatically installs necessary dependencies like pillow-heif (for AVIF/HEIC) and pymupdf (for PDF).
Convert single images easily. Metadata is preserved by default.
from imageconvert import ImageConvert
ImageConvert.convert("vacation.heic", "vacation.jpg")
ImageConvert.convert("input.png", "output.webp", quality=85)
Handle PDF documents without external tools.
# Extract all pages from a PDF as High-Res JPEGs
ImageConvert.pdf_to_images("contract.pdf", "output_folder", dpi=300)
# Create a PDF from a list of images (A4 size, contained fit)
ImageConvert.images_to_pdf(
["scan1.jpg", "scan2.jpg"],
"combined_doc.pdf",
fit_method="contain"
)
Convert an entire directory tree. Useful for optimizing libraries or web assets. Stream results as they finish and optionally use multiple processes.
results = ImageConvert.batch_convert(
input_dir="./raw_photos",
output_dir="./web_ready",
output_format=".webp",
recursive=True,
skip_existing=True,
workers=4, # optional parallelism
stream=True # yields as soon as a file is done
)
for out_path in results:
print("converted:", out_path)
skip_existing now compares modification times, so edited sources are re-converted even if an older output file exists.
### 4. Extracting Metadata
Get technical details, including GPS coordinates and PDF info.
```python
info = ImageConvert.get_image_info("photo.jpg")
print(f"Camera: {info.get('camera')}")
# Output: {'make': 'Apple', 'model': 'iPhone 13 Pro', 'exposure': {'iso': 120...}}
if 'gps' in info:
print(f"Location: {info['gps']}")
# Output: {'latitude': 40.7128, 'longitude': -74.0060}
| Format | Extension | Read | Write | Notes |
|---|---|---|---|---|
| JPEG | .jpg, .jpeg, .jfif | ✅ | ✅ | Optimized encoding |
| PNG | .png | ✅ | ✅ | Lossless |
| WebP | .webp | ✅ | ✅ | Google's web format |
| HEIC | .heic, .heif | ✅ | ✅ | iOS High Efficiency |
| AVIF | .avif | ✅ | ✅ | Next-gen compression |
| TIFF | .tiff, .tif | ✅ | ✅ | High quality archival |
.pdf | ✅ | ✅ | Multi-page support | |
| RAW | .raw | ✅ | ❌ | Read-only |
| BMP | .bmp | ✅ | ✅ | Basic bitmap |
Contributions are welcome! Please visit the GitHub Repository to report bugs or submit pull requests.
This project is licensed under the MIT License.
FAQs
A Python library for converting between different image formats with metadata preservation
We found that imageconvert demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.