Skip to content

Bridging raster & vector processing workflows without compromises - a lightweight, local, and non-destructive image-processing app

License

Notifications You must be signed in to change notification settings

paradox-solver/ImageBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageBridge 🎛️🖼️

License: MPL-2.0 Python Code style: black

ImageBridge is a lightweight desktop app to facilitate cross-format image processing workflow, including image analysis, format conversion, vectorization, Transform & Crop, and Icon & Animation Generation.

Analysis and preview of a raster image

The Graphic UI of ImageBridge

🎯 Motivation: Why ImageBridge Exists

ImageBridge addresses three critical gaps in today's image processing ecosystem—bridging the divide between convenience, capability, and integrity.

🔒 Privacy & Control

Online image processors—whether for format conversion, compression, or upscaling—require uploading your assets to unknown servers. This creates inherent privacy risks and dependency on internet connectivity. ImageBridge operates entirely locally, ensuring your images never leave your machine.

⚡ Lightweight Meets Capable

Professional suites like Photoshop, GIMP, and Inkscape are powerful but overwhelmingly heavy for quick tasks. Conversely, command-line tools like ImageMagick offer precision but at the cost of steep learning curves. ImageBridge fills the middle ground: a visual, desktop‑focused tool that is both approachable and capable, providing curated workflows without the bloat.

🛡️ Preserving Vector Integrity

While raster (bitmap) processing is mature, handling vector graphics remains surprisingly fragile. Most general‑purpose image editors destructively rasterize vectors during operations, losing scalability and editability. Meanwhile, specialized open‑source tools (Ghostscript for PDF/PS, Cairo for SVG, Potrace for tracing) are powerful but fragmented—each solves only a narrow piece of the puzzle, requiring manual orchestration.

ImageBridge orchestrates these specialized tools into a coherent, automated pipeline. Compared to other image processing software, ImageBridge focuses on a local, lightweight, fast, and non-destructive editing pipeline. It intelligently routes tasks to the appropriate backend, ensuring vectors stay vectors throughout transformations, crops, and conversions. This creates a unified workflow where format integrity is never an afterthought, but a guaranteed outcome.

In short, ImageBridge is the pragmatic bridge between the scattered excellence of open‑source graphics libraries and the need for a streamlined, privacy‑respecting, integrity‑focused desktop tool.

Raster vs Vector: The Essential Difference

🔍 Raster Images (Bitmap)

  • What: Grid of colored pixels, like a digital photograph
  • Format Examples: PNG, JPEG, BMP, GIF
  • Key Characteristics:
    • Resolution-dependent (pixels per inch)
    • Becomes blurry when enlarged ("pixelation")
    • Ideal for photos, textures, complex gradients
  • Use When: Working with photographs, detailed artwork, web images

📐 Vector Graphics

  • What: Mathematical formulas defining shapes, lines, and curves
  • Format Examples: SVG, AI, EPS, PDF (vector content)
  • Key Characteristics:
    • Resolution-independent (infinitely scalable)
    • Remains sharp at any size or zoom level
    • Smaller file sizes for simple designs
  • Use When: Creating logos, icons, illustrations, typography

⚖️ Why It Matters

  • Print & Display: Vectors ensure crisp edges at any size; rasters have fixed resolution limits
  • Editing: Vectors are easily modified (color, shape, size); rasters are pixel-level edits
  • Workflow: Understanding both unlocks professional design capabilities

🔗 ImageBridge's Role

This tool bridges both worlds: converting raster artwork into clean vector graphics while preserving the unique strengths of each format throughout the process.

✨ Functions

Image Analysis

  • ℹ️ Comprehensive and detailed image information

  • 📈 Deep analysis on raster and vector elements

  • 🖼️ Explicit preview of processing results

    Analysis and preview of a raster image Analysis and preview of a vecter image Analysis and preview of a mixed image

    Analysis and preview of a raster, a vector, and a mixed image

Format Conversion

  • 🖼️ Batch bitmap conversion: PNG ⇄ JPEG ⇄ BMP ⇄ TIFF
  • 📱Supporting Apple formats: HEIC → PNG ⇄ JPEG ⇄ BMP ⇄ TIFF
  • 🧭 Vector conversion: SVG ⇄ PDF ⇄ EPS/PS
  • 🌉 Conversion between bitmaps and vectors: SVG/PDF/EPS/PS ⇄ PNG/JPEG/BMP/TIFF
  • 🖋 Preserving vector characteristics among vector format conversion
  • Note: in this mode, bitmap → vector involves direct embedding of raster images. For converting a bitmap into a TRUE vector image, refer to Vectorization in Ink Magic.

Ink Magic (Grayscale and Vectorization)

  • 🖼 Convert images to ink effects: grayscale or binarization (black & white)

    Analysis and preview of a mixed image Analysis and preview of a mixed image Analysis and preview of a mixed image

    Grayscale effects: original image → grayscale → binarized

  • 🖋 Vectorize raster images: get the vector sketch of a bitmap by tracing its outline

    Analysis and preview of a mixed image Analysis and preview of a mixed image Analysis and preview of a mixed image

    Vectorization effects: original bitmap → binarized vector sketch → 8-colored vector sketch

  • Vectorized images can be scaled infinitely

Transform

  • Easily Scale, Resize, Flip, and Rotate images with explicit preview

  • Preserving vector characteristics for vectors (.svg, .pdf, and .eps)

  • Upscale bitmaps (.jpg, .png, .bmp, .tiff) with enhancement options (sharpening and Gaussian blurring effects)

    Analysis and preview of a mixed image Analysis and preview of a mixed image Analysis and preview of a mixed image Analysis and preview of a mixed image

    Transform examples: original image → rotated image → flipped image → scaled and flipped image

Crop

  • Easily Crop images with explicit preview

  • Preserving vector characteristics for vectors (.svg, .pdf, and .eps)

  • Automatically determine cropping units (px or pt)

    Analysis and preview of a mixed image Analysis and preview of a mixed image Analysis and preview of a mixed image Analysis and preview of a mixed image

    Cropping examples: original bitmap → cropped bitmap → original vector → cropped vector

Icon Generation

  • Easily generate .ico icon files from .bmp images
  • Allow multiple various-size images

GIP Animation Generation

  • Easily generate .gif animation from .png images

  • Customize duration and loop numbers

    Analysis and preview of a mixed image

    A GIF animation generated from the bridge images

📦 Installation

✅ Requirements

  • Python 3.x (recommended: latest 3.x release)
  • Required Python packages:
    • Pillow, pillow-heif, numpy, cairosvg, reportlab, PyPDF2
      (see requirements.txt for the full list)
  • External tools (for vector workflows):
    • Ghostscript – PostScript/PDF interpreter for vector↔bitmap and vector↔vector conversions
    • pstoedit – Convert PS/EPS/PDF graphics to other vector formats (e.g., SVG)
    • pdftops - Converts PostScript and PDF graphics to other vector formats such as SVG, DXF, EMF, etc.
    • Potrace – Trace bitmaps to clean, scalable vectors
    • libcairo-2.dll – Cairo graphics runtime required by certain SVG/PDF operations

ℹ️ ImageBridge provides an in‑app “Tool Check” to verify the availability of these external tools.

🛠️ Setup

  1. Create a virtual environment and install dependencies:

    python -m venv venv
    # On Windows:
    .\venv\Scripts\Activate.ps1
    # Alternatively, on Linux:
    source venv/bin/activate
  2. Install Python dependencies:

      pip install -r requirements.txt
    
  3. Install external tools (if you need vector format-conversion workflows):

    • Download and install the following external tools if you need specific format-conversion workflows. Ensure they are available in your system PATH.
      • Ghostscript: used for conversions
        • .pdf/.eps/.ps → bitmaps
        • .eps/.ps.pdf
        • .eps.ps
      • pstoedit: used for conversion
        • .pdf/.eps/.ps.svg
      • libcairo-2.dll (Cairo): used for conversion
        • .svg → bitmaps/.pdf/.eps/.ps
      • pdftops used for conversion
        • .pdf.eps/.ps conversions
      • Potrace: used to vectorize black-and-white bitmaps
    • Install each external tool on request. Not installing a specific tool does not disturb other functions.
    • Check the About tab of the app for whether these tools are successfully installed.

🚀 Run

Simply run

python main.py

to activate GUI.

🧭 Usage Overview

Note: Image loading & processing may take several seconds—this is normal, during which the app may SEEM stuck. However, the app remains responsive internally while completing intensive operations. To ensure reliability, all image-processing functions run on the main thread. Contributions adding multi‑threading for improved interactivity are welcome.

1) Convert

  • Convert between a variety of image formats in batch
    • Select input images by clicking Browse...
    • Check details of the input images by clicking Details...
    • Select output folder by clicking Select...
    • Select Out Format
    • Specify conversion Parameters if applies
    • Click Convert
    • Check Log Output and Output Preview to inspect the conversion process
    • Click Open... to open the output folder

2) Ink Magic

  • Turn bitmaps into grayscale
    • Select input images by clicking Browse...
    • Check details of the input images by clicking Details...
    • Select output folder by clicking Select...
    • Choose Binarize if need black-and-white image
    • Click Preview to check the result without saving
    • Click Save to execute and save
    • Check Log Output and Output Preview to inspect the conversion process
    • Click Open... to open the output folder
  • Vectorize bitmaps
    • Select input images by clicking Browse...
    • Check details of the input images by clicking Details...
    • Select output folder by clicking Select...
    • Choose Colored if need multi-color vectorization, then select the number of colors
    • Click Preview to check the result without saving
    • Click Save to execute and save
    • Check Log Output and Output Preview to inspect the conversion process
    • Click Open... to open the output folder

3) Transform/Crop

  • Transform or crop an image (bitmap or vector)
    • Select input images by clicking Browse...
    • Check details of the input images by clicking Details...
    • Select output folder by clicking Select...
    • Configure transform/crop options
    • Click Preview to check the result without saving
    • Click Save to execute and save
    • Check Log Output and Output Preview to inspect the conversion process
    • Click Open... to open the output folder

4) Icon/Animation

  • Compose .ico icon or .gif animation out of bitmaps
    • Select input images by clicking Browse...
    • Check details of the input images by clicking Details...
    • Select output folder by clicking Select...
    • Configure icon/animation options
    • Click Generate to generate and save
    • Check Log Output and Output Preview to inspect the conversion process
    • Click Open... to open the output folder

🧪 Notes and Tips

  • DPI only affects print/embedding size for bitmaps; screens care about pixels. See the Image Formats guide for more.
  • When converting vectors to bitmaps, prefer higher DPI (e.g., 300–600) for crisp print output.
  • Large image batches may take time; the UI logs progress and errors in the bottom log area.

🎨 Design Rationale & Philosophy

ImageBridge embodies a deliberate design philosophy that prioritizes clarity, integrity, and simplicity over feature bloat. Every technical choice reflects a core set of principles aimed at creating a tool that is both transparent and dependable.

🌟 Core Principles

  • 📍 Local & Self‑Contained – All processing occurs on your machine. No cloud uploads, no registration, and no network dependency ensure privacy and offline usability.
  • 📦 Lightweight & Open – Built upon established, open‑source libraries and tools (Pillow, Cairo, Potrace, etc.). The architecture avoids monolithic dependencies, favoring modularity and user‑verifiable components.
  • 🎯 Simplicity as a Feature – The interface (Tkinter) is purposefully straightforward. Functionality is focused, tested, and robust—avoiding the complexity that often leads to instability in larger suites.
  • 🔓 Transparency & Safety – The application requires minimal system permissions, makes no destructive changes to original files, and leaves no persistent footprint on your system—it is effectively "portable" in ethos.
  • 👁️ Direct Feedback – A live preview pane provides immediate, What‑You‑See‑Is‑What‑You‑Get (WYSIWYG) feedback for every operation, eliminating guesswork.
  • ⚖️ Reliability over Generality – It excels within a defined scope (cartoon, logo, and sketch‑style artwork) by providing predictable, high‑quality results rather than attempting to be a universal solution for all image types.
  • 🛡️ Format Integrity – The workflow respects the inherent nature of each graphic type. Raster operations stay in the raster domain, and vector processing preserves vector mathematical definitions. Format conversions are performed non‑destructively; vectors remain scalable, and details are retained wherever possible.

🔧 Philosophy in Practice

These principles directly inform the technical implementation. The multi‑stage vectorization pipeline—color quantization, layer separation, and Potrace tracing—is designed for control and clarity, not automation at all costs. Parameters are exposed judiciously, allowing users to influence the output while the tool handles the complexity. The use of svgutils for composition instead of manual SVG manipulation reflects the commitment to using robust, specialized libraries for tasks they are designed to solve.

In essence, ImageBridge is not just a set of utilities; it is a curated workflow that values the user's control, the integrity of their assets, and the elegance of a simple, reliable tool. 🎭✨

🙏 Special Thanks

ImageBridge leverages the following external tools to facilitate vector format-conversion workflow

  • Ghostscript – PostScript/PDF interpreter used for conversions
  • pstoedit – PS/EPS/PDF to SVG and other vector formats
  • Potrace – Bitmap‑to‑vector tracing
  • pdftops - pdf to ps converter
  • libcairo-2.dll – Cairo graphics runtime used by vector processing

📄 License

MIT License. See LICENSE.

🤝 Contributing

Issues and PRs are welcome. If you add support for more formats or platforms, please document any new external dependencies and add checks to the Tool Check section.