Skip to main content

๐Ÿ“ธ SnapForge

PyPI Python License Made with Pillow Status

Forge your images with a single chain of commands.

A lightweight, fast and intuitive Python library for image processing built on top of Pillow.

Perfect for compressing, resizing, filtering, enhancing and transforming images.

โœจ Features

  • ๐Ÿ–ผ๏ธ Load and create images
  • ๐Ÿ“ Resize and transform images
  • ๐Ÿ”„ Advanced format conversion
  • ๐ŸŽจ Image mode conversion
  • ๐Ÿ’พ Save and optimize images
  • ๐Ÿช„ Image effects
  • ๐Ÿงฉ Image overlays
  • ๐ŸŽฌ Image motion and animation
  • ๐Ÿ” Image inspection
  • ๐Ÿ”„ Update checking
  • ๐Ÿ”— Chainable API design
  • ๐Ÿงพ MIT License

๐Ÿ”„ Professional Format Converter ๐Ÿ”„

The convert method (Storage.convert) supports more than 9 formats:

JPEG, JFIF, JPG, PNG, WEBP, GIF, TIFF, BMP, ICO and more.

SnapForge supports common Pillow modes such as:

  • RGB
  • RGBA
  • L
  • LA
  • P
  • CMYK
  • 1

๐Ÿ“ฆ Installation

You can install SnapForge directly from PyPI using pip:

pip install snapforge

Or if you have already installed it:

pip install snapforge --upgrade

๐Ÿš€ Quick Start

Here is quick example to get you started with SnapForge:

from snapforge import Storage, Geometry, SnapForgeUpdater , Effects

version = "your_version"

updater = SnapForgeUpdater("snapforge", version)

updater.start_check()

# Complete image path
img = Storage.load(r"...\my_image.jpeg")

img = Storage.convert_mode(img, "RGB")

img = Effects.apply_thermal(img,'arctic')

img = Geometry.round_corners(img, 40)

img = Storage.convert(img, "png")

# Complete image path
img=Storage.save(
    img,
    r"...\my_rounded_image.png"
)

Storage.show(img)

๐Ÿ“– Available Modules

SnapForge is now fully modular ๐Ÿ”ง โ€” each module has a single responsibility and can be imported independently:

from snapforge import (
    Storage,
    Geometry,
    Effects,
    Overlays,
    Motion,
    Inspector,
    SnapForgeUpdater
)
  • ๐Ÿ“ Geometry โ€” resizing, cropping, rotating and transforming
  • ๐Ÿ’พ Storage โ€” loading, saving and format conversion
  • ๐Ÿ” Inspector โ€” metadata, channels, histogram and color analysis
  • ๐ŸŽจ Effects โ€” lighting and filters
  • ๐Ÿ–ผ๏ธ Overlays โ€” text, watermark, borders and blending
  • ๐ŸŽฌ Motion โ€” creating slide and bounce animations
  • ๐Ÿ”„ SnapForgeUpdater โ€” update checks and version comparison

๐Ÿ“ฆ Available Methods

Here is the complete list of all available methods in each snapforge module:

๐Ÿ“ Geometry

Method Description Example
Geometry.resize(img, w, h) Change image dimensions Geometry.resize(img, 800, 600)
Geometry.thumbnail(img, w, h) Resize while keeping aspect ratio Geometry.thumbnail(img, 500, 500)
Geometry.fit(img, w, h) Resize and crop to exact dimensions Geometry.fit(img, 1080, 1080)
Geometry.crop(img, l, t, r, b) Crop image Geometry.crop(img, 0, 0, 100, 100)
Geometry.rotate(img, a) Rotate image Geometry.rotate(img, 90)
Geometry.flip(img, dir) Flip image Geometry.flip(img, "horizontal")
Geometry.round_corners(img, radius) Round image corners Geometry.round_corners(img, 40)

๐Ÿ’พ Storage

Method Description Example
Storage.load(path) Load image from file Storage.load("photo.jpg")
Storage.save(img, name) Save image Storage.save(img, "result.jpg")
Storage.convert(img, fmt) Change image format (PNG, JPG, WEBPโ€ฆ) Storage.convert(img, "PNG")
Storage.optimize(img, q) Set JPEG quality Storage.optimize(img, 85)
Storage.convert_mode(img, mode) Change image color mode Storage.convert_mode(img, "RGB")
Storage.new(mode, size, color) Make a new image but don't save it Storage.new("RGB", (800, 600), "white")

๐ŸŽฌ Motion

Method Description Example
Motion.slide(img, direction, frames, duration) Create a one-way motion animation Motion.slide(img, "left", 30, 100)
Motion.bounce(img, direction, frames, duration) Create a forward and backward motion animation Motion.bounce(img, "horizontal", 30, 100)

Supported Motion.slide directions:

  • left
  • right
  • up
  • down

Supported Motion.bounce directions:

  • horizontal
  • vertical

๐Ÿ” Inspector

Method Description Example
Inspector.get_metadata(img) Extract detailed image metadata Inspector.get_metadata(img)
Inspector.histogram(img) Generate histogram data Inspector.histogram(img)
Inspector.compare(img) Display metadata and processing summary Inspector.compare(img)
Inspector.channels(img) Show image channels and color mode inspector.channels(img)
Inspector.extract_color_palette(img,color_num) Get dominant colors as Hex codes Inspector.extract_color_palette(img,5)

๐ŸŽจ Effects (Lighting & Filters)

Method Description Example
Effects.apply_thermal(style) Apply a thermal-style color effect effects.apply_thermal("classic")
Effects.apply_contrast(img, f) Adjust contrast Effects.apply_contrast(img, 1.5)
Effects.auto_enhance(img) Improve brightness, contrast and sharpness Effects.auto_enhance(img)
Effects.invert(img) Invert image colors Effects.invert(img)
Effects.apply_sepia(img) Classic sepia effect Effects.apply_sepia(img)
Effects.apply_grayscale(img, f) Convert to grayscale Effects.apply_grayscale(img, 1.0)
Effects.apply_blur(img, r) Gaussian blur Effects.apply_blur(img, 5.0)
Effects.apply_sharpen(img, f) Sharpen image Effects.apply_sharpen(img, 1.0)
Effects.apply_camscanner(img) Document scanner effect Effects.apply_camscanner(img)
Effects.apply_preset(img, name) Apply a professional preset Effects.apply_preset(img, "vintage")

Supported presets (Effects.apply_preset) :

vintage, 
"cinematic", 
"vibrant", 
"dreamy", 
"noir", 
"warm", 
"cool"

Supported Styles (Effects.apply_thermal) :

"classic",
"iron",
"rainbow",
"arctic"

๐Ÿ–ผ๏ธ Overlays

Method Description Example
Overlays.add_watermark(img, path) Add watermark Overlays.add_watermark(img, "logo.png")
Overlays.add_text(img, text, pos) Draw text Overlays.add_text(img, "Hello!", (50, 50))
Overlays.add_border(img, size, color) Add border Overlays.add_border(img, 10, (0, 0, 0))
Overlays.double_exposure(img, img2, mode) Blend with another image Overlays.double_exposure(img, "layer.png", "blend")

๐Ÿ”„ SnapForgeUpdater

Method Description Example
SnapForgeUpdater.__init__(package_name, current_version) Initialize the updater with the package name and current version SnapForgeUpdater("snapforge", "3.0.0")

To check updates run:

updater = SnapForgeUpdater("snapforge", "your_version")

updater.start_check()

๐Ÿ› ๏ธ Requirements

To use SnapForge, ensure you have the following installed:

  • Python: 3.14 or higher

  • Dependencies:

    • Pillow (for image processing)
    • requests (for automatic update checks)
    • packaging (for version comparison logic)

๐Ÿค Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

๐ŸŒŸ More Projects

If you enjoy SnapForge, you might also like these projects, too:

PixSlim

A Python image, PDF, Word and ... compression library focused on reducing file size while preserving quality.

turtle-shape

The Turtle_Shape library provides ready-made shapes and tools for creating graphics and drawings with Python's Turtle module.

๐Ÿ“œ License

Distributed under the MIT License.

โค๏ธ Support

If you find SnapForge useful, your support means a lot!

You can help by:

  • ๐Ÿ“ฆ Installing the package and trying it in your projects
  • ๐Ÿ“ Sharing feedback and suggestions
  • ๐Ÿ› Reporting bugs and improvements
  • ๐ŸŒŸ Recommending SnapForge to other Python developers

๐Ÿงฉ Every piece of feedback helps make SnapForge better. ๐Ÿ™

๐Ÿ‘ค Author

Ali.Shm

Project Maintainer

Metadata

Release files for snapforge 4.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for snapforge 4.2.0
File Interpreter ABI Platform
snapforge-4.2.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details

Release files / snapforge-4.2.0-cp314-cp314-win_amd64.whl

Download URL snapforge-4.2.0-cp314-cp314-win_amd64.whl
Size 252.3 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
72bb82aca212ab64c1b03e35c364665b56eb2eadbb4fb95f1b6aa01a055d86a7
BLAKE2b-256 checksum
How to use checksums
e4d81af968e58e664988304857bc0e64edd90606793d4492e4cce717df6e7e91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for snapforge 4.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page