🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

uitil

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uitil

Simple utilities for common tasks

pipPyPI
Version
0.1.5
Maintainers
1

uitil

Simple utility functions for common image operations.

Installation

pip install uitil

Usage

from uitil import set, get

# Embed text in an image
set('input.png', 'your data here', 'output.png')

# Extract text from an image
data = get('output.png')
print(data)

Functions

set(image_path, data, output_path=None)

Embeds text data into an image file.

Parameters:

  • image_path (str): Path to input image
  • data (str): Text to embed in the image
  • output_path (str, optional): Output path (default: adds '_out' to filename)

Returns:

  • str: Path to the output image

get(image_path)

Extracts embedded data from an image file.

Parameters:

  • image_path (str): Path to image containing data

Returns:

  • str: The extracted text

Example

from uitil import set, get

# Embed a message
output = set('photo.png', 'Hello World', 'secret.png')
print(f"Created: {output}")

# Extract the message
message = get('secret.png')
print(f"Message: {message}")

Requirements

  • Python 3.6+
  • Pillow

License

MIT

FAQs

Did you know?

Socket

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.

Install

Related posts