Skip to main content

Python Prompt to Build an Image Processing and Watermarking Pipeline

Build a Python image-processing pipeline for batch resizing, format conversion, watermarking, thumbnail generation, and metadata management at scale.

Vul de plaatshouders in

Edit the values, then copy your finished prompt.

Jouw Prompt
prompt.txt

                                

What this prompt does

This prompt makes the AI design and build a complete Python image-processing pipeline tailored to your [use_case], sized for the throughput you declare in [daily_volume] and [avg_file_size]. It pins the toolchain with [python_version] and [image_library], then asks for a chainable builder API where each step — resize, convert, watermark, optimize, save — is optional and composable. Because you state the volume and average file size up front, the AI can reason about concurrency and memory instead of producing toy code that falls over on real batches.

The structure works because it forces concrete decisions at every layer. [resize_modes] and [smart_crop_method] define how variants are derived from a source; [output_format], [jpeg_quality], and [avif_support] control encoding tradeoffs; [watermark_text] and [watermark_opacity] shape branding; and [custom_metadata] plus the EXIF-stripping rules cover privacy. The [concurrency_type], [input_source], and [output_structure] variables turn it from a single-image script into a batch system with a processing report and resume-by-hash recovery. The [size_variants] and [size_limits] variables push the AI to derive a fixed set of outputs per source and enforce a ceiling on each, while the automatic-format-selection logic decides between JPEG, WebP, PNG, and AVIF based on whether an image is a photograph or a graphic with transparency. Spelling out [quality_target] keeps the encoder from optimizing for size at the expense of visible artifacts, or the reverse.

When to use it

  • You run an e-commerce or media app where every upload needs several optimized variants
  • You need to strip GPS and camera-serial metadata before publishing images publicly
  • You want WebP or AVIF output with a JPEG fallback to cut delivery size
  • You process thousands of files per run and need resume capability after a crash
  • You need smart-cropped thumbnails that keep the focal point instead of blind center crops
  • You want a quality-assurance pass that catches corrupted output before it ships

Example output

The AI returns a structured Python codebase: a Pipeline class exposing the chainable builder methods, supporting modules for resizing, format conversion, watermarking, and metadata handling, plus a batch runner that reads from [input_source], writes to [output_structure], and emits a processing report (total, successful, failed, skipped duplicates). Expect method signatures with return types, a hash-tracking resume mechanism, and a QA step that re-opens output to confirm it is not corrupt.

Pro tips

  • Set [avg_file_size] honestly — large source files are why the prompt suggests libvips alongside Pillow in [image_library]
  • Match [concurrency_type] to your CPU count; a ProcessPoolExecutor with too many workers thrashes on memory-heavy images
  • Be explicit in [resize_specs] and [size_variants] so the AI generates the exact variant set your CDN expects
  • Keep [quality_target] and [size_limits] aligned — asking for under 200KB while demanding quality 95 will conflict
  • Name real fields in [custom_metadata] (product_id, sku) so the injected metadata is queryable later
  • If privacy matters, double-check the AI actually strips GPS/serial fields rather than only copying copyright tags

Frequently Asked Questions

Does this prompt support generating WebP and AVIF output?
Yes. The format-conversion step covers JPEG, PNG, WebP (lossy and lossless), and AVIF when you set `[avif_support]`. It also asks for automatic format selection based on content, so photographs lean toward JPEG/WebP and graphics with transparency toward PNG/WebP.
How does the resume capability work for large batches?
The batch step tracks processed files by hash, so a rerun skips images it already finished and picks up where a crash left off. This is what makes it safe to run over thousands of files without redoing completed work each time.
Will the pipeline remove sensitive metadata like GPS location?
The metadata step explicitly strips sensitive EXIF/IPTC/XMP fields such as GPS coordinates and camera serial numbers while preserving copyright and attribution. You should still verify the generated code actually removes those fields rather than only copying the ones you want to keep.
Which image library does the generated code use?
Whatever you put in `[image_library]`; the default pairs Pillow with libvips for large images. libvips matters when `[avg_file_size]` is high because it streams large images with far less memory than Pillow alone.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

Meer in Python & Automation Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support