Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Image Converter GUI

Description

A user-friendly image converter with GUI that supports conversion between 7 popular image formats. Built with Tkinter and Pillow for easy image format conversion.

Features

  • Convert between 7 image formats
  • Support for PNG, JPEG, BMP, GIF, TIFF, ICO, WEBP
  • Automatic transparency handling
  • Image info display (dimensions, format)
  • Quality preservation
  • Browse and save dialogs
  • Open output folder option
  • Clean, intuitive interface

Stack

  • Language: Python
  • Libraries:
    • Pillow==10.0.0 (image processing)
    • tkinter (standard library - GUI)
  • Complexity: Intermediate

Installation

pip install -r requirements.txt
python main.py

Supported Formats

Format Extension Notes
PNG .png Lossless, supports transparency
JPEG .jpg Lossy compression, no transparency
BMP .bmp Uncompressed, large file size
GIF .gif Supports animation, limited colors
TIFF .tiff High quality, large file size
ICO .ico Icon format, multiple sizes
WEBP .webp Modern format, good compression

How to Use

  1. Browse Image: Click "Browse Image" to select input file
  2. View Info: See image dimensions and current format
  3. Select Format: Choose output format from dropdown
  4. Convert: Click "Convert" button
  5. Save: Choose save location and filename
  6. Done: Option to open output folder

Features Explained

Transparency Handling

  • Automatically converts RGBA to RGB for JPEG/BMP
  • Preserves transparency for PNG/WEBP
  • White background for transparent images in JPEG

Quality Preservation

  • JPEG: 95% quality setting
  • PNG: Optimized compression
  • Other formats: Maximum quality

Image Info Display

  • Shows dimensions (width x height)
  • Displays current format
  • Updates after file selection

Use Cases

  • Web Development: Convert images for web use
  • Design Work: Change formats for different tools
  • Optimization: Convert to smaller formats
  • Compatibility: Ensure format compatibility
  • Batch Preparation: Quick format changes

Learning Outcomes

  • PIL/Pillow image processing
  • File dialogs in Tkinter
  • Image format handling
  • Transparency management
  • Error handling
  • GUI design patterns

Technical Details

Transparency Conversion

# Convert RGBA to RGB for JPEG
if img.mode in ('RGBA', 'LA', 'P'):
    rgb_img = Image.new('RGB', img.size, (255, 255, 255))
    rgb_img.paste(img, mask=img.split()[-1])

Quality Settings

# JPEG with high quality
img.save(output_path, 'JPEG', quality=95)

# PNG with optimization
img.save(output_path, 'PNG', optimize=True)

Common Conversions

PNG to JPEG

  • Removes transparency
  • Reduces file size
  • Good for photos

JPEG to PNG

  • Adds transparency support
  • Lossless quality
  • Larger file size

Any to WEBP

  • Modern format
  • Better compression
  • Smaller files

Future Enhancements

  • Batch conversion
  • Image resizing
  • Quality slider
  • Format recommendations
  • Drag and drop support
  • Preview before/after
  • Compression settings
  • Metadata preservation
  • Watermark addition
  • Image rotation
  • Crop functionality

Tips

  • PNG best for graphics with transparency
  • JPEG best for photographs
  • WEBP best for web use
  • Use TIFF for archival quality
  • ICO for application icons

Troubleshooting

"Cannot convert image"

  • Check if file is corrupted
  • Ensure format is supported
  • Try different output format

"Permission denied"

  • Close image if open in another program
  • Choose different save location
  • Check folder permissions

Large file sizes

  • Use JPEG for photos
  • Use WEBP for better compression
  • Avoid BMP and TIFF for web

License

Open source for educational purposes.