I have compiled methods to prevent image reuse on Micro.blog. While I initially wrote this in Japanese, I’ve updated and rewritten it in English since there are few Japanese users.

Pinterest Protection

To prevent Pinterest users from pinning your images, add the following meta tag to your blog:

<meta name="pinterest" content="nopin" />

This can be implemented using the Meta tags plug-inMeta tags plug-in.

Automated Watermarking System

I’ve created a shell script to simplify the process. This script performs three key functions:

  • Optimizes images for Micro.blog through resizing
  • Adds copyright information
  • Converts images to TIFF format and optimizes file size using Optimage

Prerequisites

  • macOS operating system
  • ImageMagick version 7.x or higher
  • Optimage application

The copyright text is hard-coded in the script - please replace it with your own information when using.

#!/bin/sh


# Argument check
if [ $# -ne 1 ]; then
    echo "Usage: $0 <input-image-file>"
    exit 1
fi


# Input file existence check
input_file="$1"
if [ ! -f "$input_file" ]; then
    echo "Error: File '$input_file' not found"
    exit 1
fi


# Create backup file
backup_file="${input_file}.bak"
if ! cp "$input_file" "$backup_file"; then
    echo "Error: Failed to create backup file"
    exit 1
fi
echo "Backup created: $backup_file"


# Create temporary file
temp_tiff="/tmp/image_$(date +%s).tiff"


# Image processing
if ! magick "$input_file" \
    -resize 1800x1800 \
    -gravity southeast \
    -fill white \
    -pointsize 20 \
    -annotate +15+30 '© 2024 Toshiyuki Yoshida' \
    -pointsize 16 \
    -annotate +15+10 'CC BY-NC-SA 4.0' \
    -format tiff \
    "$temp_tiff"; then
    echo "Error: Image processing failed"
    rm -f "$temp_tiff"
    exit 1
fi


# Optimize with Optimage (outputs jpg)
open "$temp_tiff" -W -n -a Optimage --args -exit YES


# Find Optimage-created jpg file
optimized_jpg="${temp_tiff%.*}.jpg"


# Check optimized file existence
if [ ! -f "$optimized_jpg" ]; then
    echo "Error: Optimage output file not found"
    rm -f "$temp_tiff"
    exit 1
fi


# Overwrite original file
if ! mv "$optimized_jpg" "$input_file"; then
    echo "Error: Failed to update original file"
    rm -f "$temp_tiff" "$optimized_jpg"
    exit 1
fi


# Clean up temporary files
rm -f "$temp_tiff"
rm -f "$optimized_jpg"


echo "Image processing completed: $input_file"

The script automatically resizes images, adds a watermark with copyright information, and optimizes the file size while maintaining quality. The watermark includes both a copyright notice and Creative Commons license information.