Skip to content

Examples

Celfie Lock edited this page Jan 7, 2026 · 1 revision

Examples

Basic Encoding

from celfie import encode, decode

encode("input.jpg", "output.png", "Hello, World!")

With Link

encode("photo.jpg", "protected.png", "Copyright 2025", link="https://mywebsite.com")

With Watermark

encode(
    "photo.jpg",
    "protected.png",
    "My secret",
    watermark_text="My Brand",
    watermark_position="bottom-right",
    watermark_opacity=0.7
)

Batch Processing

import os
from celfie import encode

for img in ["photo1.jpg", "photo2.jpg"]:
    output = f"protected_{img.replace('.jpg', '.png')}"
    encode(img, output, "Copyright 2025")

Decoding

message = decode("protected.png")
print(message)

Clone this wiki locally