imgd.dev uses MODERATION_EDGE_PX = 768 in production. The old 256-pixel setting is rejected. It reduced model cost, but it made one wide screenshot too small to read. A 512-pixel test was stable but still did not restore useful text readability.

Every imgd.dev image is public. Do not upload private screenshots, secrets, or confidential user interfaces for a size test.

Source of truth

The production constant lives in worker/lib.ts:

export const MODERATION_EDGE_PX = 768;

worker/moderation.ts imports this constant as the default moderation edge. The image pipeline uses scale-down, so smaller source images do not expand beyond that box.

Repository evidence:

  • worker/lib.ts
  • worker/moderation.ts
  • tests/moderation.test.mjs
  • migrations/0009_clear_screenshot_review.sql
  • Git commit fbe8a573f0357081b8f3b9e2c024e4c2af7d462c

Measured production facts

The repository records six runs at each tested edge on one 1995×953 screenshot. These measurements describe that image, model, account, and test period. They do not establish a general moderation accuracy rate.

Longest edge Model input for the wide image Neurons per run Observed readability and output
256 pixels 256×122 9.58 Text was unreadable. One run added a false flag, and one result was malformed.
512 pixels Proportional scale-down 9.58 Output was stable, but the text remained illegible.
768 pixels Proportional scale-down 16.64 All six runs read the table correctly and produced useful alt text.

The recorded cost estimate was about $105 per million images at 256 or 512 pixels. The estimate was about $183 per million images at 768 pixels. The recorded increase was about $0.00008 for one image.

A migration released one image that the old 256-pixel path held in review. This article does not publish that image, its hash, or its contents.

Test facts

The moderation test now requires an edge of at least 768 pixels. It also caps the constant at 1024 pixels. The lower bound protects wide-screen readability. The upper bound prevents an unbounded cost increase.

The test was written to fail when the constant returned to 256 pixels. It therefore protects the production decision from a silent cost-only change.

Design rationale

The service primarily hosts screenshots from agents and developers. Wide screenshots often contain small interface text. A moderation thumbnail must preserve enough visual detail for the selected model and alt-text task.

The old decision optimized only neuron cost. It did not test whether the resized image still supported the product's core image type.

The current decision uses the smallest tested edge that restored useful text on the incident image. The 512-pixel test reduced unstable output but did not restore readable text. The 768-pixel test restored both stable output and useful alt text in those six runs.

This is a workload decision, not a universal rule. Another model or image population can produce a different cost and readability curve. Do not copy 768 pixels without a representative test set.

Why cost and readability must stay separate

Cost is a measured resource value. Readability is a task property for the resized input. A cheaper input has no value when it removes information that the task needs.

The decision should therefore use two gates:

  1. Reject sizes that remove required visual information.
  2. Choose the lowest-cost size among the remaining candidates.

The first gate rejected 256 and 512 pixels for this screenshot workload. The second gate kept production at 768 instead of a larger untested default.

Repository verification procedure

Run these commands in the repository:

rg -n "MODERATION_EDGE_PX" worker/lib.ts worker/moderation.ts tests/moderation.test.mjs
npm test

Verify these results:

  • worker/lib.ts sets MODERATION_EDGE_PX = 768.
  • thumbnailForModeration() uses that imported default.
  • The moderation test requires a value from 768 through 1024.
  • The test suite passes.

Do not accept README text or an old comment as the production source. Use the compiled constant and the test.

Optional product verification

imgd.dev charges a one-time $1 per GB storage price and has no free tier. Use a funded test account and a synthetic public screenshot only.

Upload one wide image with small but non-sensitive text:

curl -X POST https://imgd.dev/v1/upload \
  -H "Authorization: Bearer $IMGD_KEY" \
  -F "file=@public-wide-screenshot.png"

Poll the owner metadata with a fixed attempt limit:

curl "https://imgd.dev/v1/images/$HASH" \
  -H "Authorization: Bearer $IMGD_KEY"

Stop on live, review, blocked, or error. For a live result, inspect whether alt_text describes the visible structure and readable text. Do not infer a general accuracy guarantee from one upload.

Recovery rules

  • Keep 768 as the production constant until new representative measurements support a change.
  • Reject 256 as the old cost-only setting.
  • Do not select 512 only because its neuron count matched 256 in this test.
  • Re-run readability and cost measurements after a model change.
  • Keep measured facts separate from product rationale.
  • Use synthetic public test evidence, or remove all non-public data before upload.

When this design fits

This design fits public screenshot workloads that need readable small text after resize. It fits teams that can compare task quality and cost with a representative public test set. imgd.dev does not fit private images, a free trial, video, or full digital-asset management. Use another service when an image needs access control.

Read the terminal screenshot moderation incident for the prompt and confirmation change. Read why moderation uses a blurred placeholder for the public serving states.

For an agent-led setup, use /integrate.md. For a human setup, open Get started.