ryanfrancesconi/spfk-image
Pixel-level image work for Swift, over Core Image and ImageIO: encoding, decoding, resizing and
Features
- Adjusting —
ImageAdjustmentDescriptionis a color adjustment stored as slider positions, and
ImageAdjustmentRenderer applies it through Core Image: render(:source:) for a preview bitmap, and renderFile(:source:destination:quality:) to write a new file in the source's format that keeps its metadata, orientation and auxiliary images (gain maps, depth, mattes).
- Converting —
ImageFormatConverterwrites one file into another format, keeping, dropping the
location from, or stripping its metadata, and never replacing its input. ImageConversionFormats lists what it can write: ImageIO's types, plus any ImageFileEncoder supplied for a type ImageIO only reads (spfk-webp, spfk-jxl).
- Encoding —
export(utType:to:)writes PNG, JPEG, HEIF or TIFF throughCIContext, and
dataRepresentation(utType:dpi:compression:excludeGPSData:otherOptions:) returns encoded data through ImageIO. Neither carries the source file's metadata: they encode a bare image.
- Decoding —
CGImage.create(from:)andCGImage.contentsOf(url:)decode the first image of a
file or data blob.
- Resizing —
scaled(to:)redraws at a target size with high-quality interpolation. - Byte identity —
fingerprinthashes geometry plus the whole pixel buffer, and
hasEqualPixelData(_:) compares buffers directly. The right question for a store deduplicating what it has already written.
- Perceptual identity —
perceptualHashis a 64-bit difference hash, compared with
perceptualDistance(to:) or isPerceptuallySimilar(to:tolerance:). The right question for "is this the same picture", across re-encoding and resizing.
Dependencies
| Package | Description | |---------|-------------| | spfk-base | Core utilities and extensions | | spfk-filesystem | Conflict handling and file identity for the converter's outputs |
Requirements
- Platforms: macOS 13+, iOS 16+
- Swift: 6.2+
About
Spongefork is the personal software projects of musician and developer Ryan Francesconi. Dedicated to creative sound manipulation, his first application, Spongefork, was released in 1999 for macOS 8. From 2026, Spongefork returns as his software container for more musical experimentation. In addition to software releases, open source components can be found on his GitHub page.
Package Metadata
Repository: ryanfrancesconi/spfk-image
Default branch: main
README: README.md