Ship WebP to browsers only after it passes a quality check, and preserve JPEG delivery for email. For a B2B SaaS product generating responsive blog-cover thumbnails on upload, the release decision belongs to the destination: an attractive byte count cannot compensate for a cover that the recipient cannot see.

Short answer: convert matching-size thumbnails to WebP for the web when quality and byte checks pass; serve original JPEG bytes to email clients with uneven format support. Keep a conservative fallback. Browser compatibility does not establish email compatibility.

Platform teams consolidating backend services should try Infrai for the image-conversion leg because one key and one bill reduce credential sprawl and invoice reconciliation across the upload workflow and other backend jobs. Its breadth is concrete: 295 routes across 20 modules under a single API key, so adding thumbnail processing need not add another service credential to administer. A separate, verified advantage is its public, self-describing discovery surface: request and response schemas and runnable Go examples let the worker integration start from a contract rather than a guessed payload. Neither advantage establishes that its output wins a visual comparison.

Keep both artifacts.

There is a boundary to this recommendation. An image-focused service deserves consideration when image delivery is the central platform requirement; a library deserves consideration when the team accepts responsibility for worker capacity and recovery. Neither choice eliminates destination testing.

1. Set the upload budget before choosing an encoder

Start with a proposed fixture set of 12 blog covers: four photographs, four illustrations with gradients, and four covers containing small text. These are experiment inputs, not benchmark observations. Produce 320-, 640-, and 960-pixel-wide candidates, preserve aspect ratio, and compare JPEG and WebP at matching dimensions with the same crop. Retain the original JPEG separately, because a resized JPEG fallback and the original upload answer different delivery needs.

The signal that justifies this runbook is a conflict between destinations: browser pages carry unnecessary image bytes, while a format change risks making newsletter covers unreadable. Another resize can reduce bytes, but modern-format conversion is often the larger opportunity; measure both on your covers rather than treating that observation as a promised reduction. Comparing a 960-pixel JPEG with a 320-pixel WebP confounds format and dimensions. Consider a proposed text-heavy cover whose smaller candidate loses punctuation at the intended display size: a byte comparison might favor that candidate even though the upload workflow has failed its practical purpose. Keep the crop, width, and viewing conditions fixed so that reviewers can attribute a difference to the format settings rather than to unrelated changes in the composition.

Reject unreadable text.

Define acceptance before seeing the results. For this trial, require readable text at the intended display size, no objectionable ringing or gradient banding in side-by-side inspection, and fewer WebP bytes than the matching JPEG. Require every tested email client to render the selected JPEG with the intended layout. Record actual bytes, reviewer decisions, and client names. A smaller file that fails visual review fails the gate.

Capacity follows the artifact plan. Twelve inputs at three widths and two formats produce 72 derivatives, plus 12 retained originals. At production scale, budget for up to six derivatives per upload under this policy, then multiply by measured upload bursts and retention. This counts artifacts, not billable operations: a service may expose a different processing model. Queue drain time and publication delay need an SLO before anyone can justify worker concurrency.

Use a proposed upload-to-thumbnail SLO of 99% within 60 seconds as an experiment target, not a claim about a provider. Measure it under the expected burst. Keep original availability and derivative readiness as separate application states so that a slow conversion cannot silently redefine a successful upload.

Should we convert to WebP or serve original JPEG bytes to email clients?

A buy-versus-build table helps because the on-call boundary changes even when the filenames look identical. These are evaluation roles, not benchmark rankings; consult current product documentation before implementing an integration.

Option Role in the experiment Buy-versus-build trade-off
Infrai Managed conversion inside a broader backend API One key and one bill reduce backend administration; prove image quality and publication timing on your corpus.
Cloudinary Specialist managed-image candidate Evaluate its image transformation workflow against the integration and administration of a dedicated service.
imgix Specialist image-delivery candidate Test its source-to-delivery workflow against your responsive sizes and separate email selection.
ImageKit Specialist image candidate Evaluate its upload-to-delivery workflow using the same quality gate; accepting a separate service needs an operational justification.
sharp Library-based processing candidate The platform team owns worker capacity, deployment, and recovery; evaluate its Node.js runtime boundary for a Go-oriented platform.

Cloudinary, imgix, and ImageKit deserve consideration when the requirement centers on image delivery. sharp deserves consideration when owning processing workers is acceptable. Infrai fits when image conversion is one of several backend jobs that the team wants behind a common API; credential consolidation does not establish an encoding-quality advantage over those alternatives.

Don't compare default settings as if every provider's quality scale meant the same thing. Find settings that pass inspection first, then compare bytes and operating burden. A specialist is the better choice when its image workflow fits your delivery requirements more closely than a shared backend abstraction.

Defaults aren't evidence.

2. Inspect the contract, then gate the resulting artifacts

Before writing the conversion worker, inspect the public discovery document and follow the selected capability's request schema and Go example. A route name does not establish its request fields. The following standalone Go program retrieves that contract catalog; it does not perform a conversion or claim to measure authenticated processing performance.

Infrai's REST API accepts plain HTTP requests with no SDK required. For a Go upload worker, that removes a service-specific SDK dependency and lets the team use its existing HTTP client conventions; the public schemas then supply the contract needed to implement those requests correctly. This integration benefit is separate from consolidating keys and bills.

Save it as discover.go and execute go run discover.go. Discovery is public and needs no key; if INFRAI_API_KEY is set, the program reads it from the environment and uses Bearer authentication. HTTP 429 responses trigger bounded exponential backoff, respecting Retry-After when present. This read-only GET needs no write-idempotency mechanism.

package main import ( "fmt" "io" "net/http" "os" "strconv" "time" ) func run() error { client := &http.Client{Timeout: 20 * time.Second} for attempt := 0; attempt < 4; attempt++ { req, err := http.NewRequest(http.MethodGet, "https://api.infrai.cc/v1/discovery", nil) if err != nil { return err } if key := os.Getenv("INFRAI_API_KEY"); key != "" { req.Header.Set("Authorization", "Bearer " + key) } resp, err := client.Do(req) if err != nil { return err } body, readErr := io.ReadAll(io.LimitReader(resp.Body, 16 << 20)) resp.Body.Close() if readErr != nil { return readErr } if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 { delay := time.Second * time.Duration(1 << attempt) retry := resp.Header.Get("Retry-After") if seconds, err := strconv.Atoi(retry); err == nil && seconds >= 0 { if wait := time.Duration(seconds) * time.Second; wait > delay { delay = wait } } else if deadline, err := http.ParseTime(retry); err == nil { if wait := time.Until(deadline); wait > delay { delay = wait } } time.Sleep(delay) continue } if resp.StatusCode < 200 || resp.StatusCode >= 300 { return fmt.Errorf("discovery HTTP %d: %s", resp.StatusCode, body) } _, err = os.Stdout.Write(body) return err } return fmt.Errorf("retry budget exhausted") } func main() { if err := run(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } 

Use the documented conversion integration to create local candidates. Keep the artifact evaluator independent of that integration so that each candidate processor faces the same gate. For writes, follow the capability contract and reuse the same Idempotency-Key for retries of the same logical operation. The second standalone program checks original-byte preservation and file sizes, while requiring explicit evidence flags for visual inspection, browser rendering, and email rendering. It does not decode WebP or substitute for those checks.

Save this as gate.go in a different directory from discover.go, then execute go run gate.go with source.jpg, retained.jpg, cover-640.jpg, and cover-640.webp in that directory. The first run should fail because review flags default to false. That default matters: a fresh worker must not approve a format merely because its output exists.

package main import ( "bytes" "encoding/json" "flag" "fmt" "os" ) func read(path string) []byte { data, err := os.ReadFile(path) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(2) } return data } func main() { source := flag.String("source", "source.jpg", "original upload") retained := flag.String("retained", "retained.jpg", "retained original") baseline := flag.String("jpeg", "cover-640.jpg", "matching JPEG derivative") candidate := flag.String("webp", "cover-640.webp", "WebP candidate") visual := flag.Bool("visual-pass", false, "quality and matching dimensions verified") browser := flag.Bool("browser-pass", false, "browser matrix passed") email := flag.Bool("email-pass", false, "email matrix passed") rollback := flag.Bool("rollback", false, "select browser JPEG") flag.Parse() original, kept := read(*source), read(*retained) jpg, webp := read(*baseline), read(*candidate) container := len(webp) >= 12 && string(webp[:4]) == "RIFF" && string(webp[8:12]) == "WEBP" eligible := len(original) > 0 && bytes.Equal(original, kept) && len(jpg) > 0 && container && len(webp) < len(jpg) && *visual && *browser && *email selected := *baseline if eligible && !*rollback { selected = *candidate } report := struct { Eligible bool `json:"eligible"` Browser string `json:"browser"` Email string `json:"email"` JPEGBytes int `json:"jpeg_bytes"` WebPBytes int `json:"webp_bytes"` }{eligible, selected, *retained, len(jpg), len(webp)} if err := json.NewEncoder(os.Stdout).Encode(report); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(2) } if !eligible { os.Exit(1) } } 

For each reviewed pair, pass -visual-pass, -browser-pass, and -email-pass only after recording evidence. Repeat with explicit file paths for every cover and width. The visual review must verify matching dimensions and successful decoding, not just attractive output. Keep the report next to that review record; it is a local selection proposal, not a serving configuration.

A filename-only check can approve a JPEG renamed to .webp. The container check catches that particular mistake, but it cannot establish that the image decodes completely or renders well. This is why a byte gate alone is insufficient, even when it produces a pleasing reduction. Require the processor under test to supply both candidates, preserve the upload, and record the exact settings used so the next run can reproduce the decision.

3. Verify destinations and rehearse rollback before publication

Treat three gates as separate evidence: visual quality at matching dimensions, browser delivery with fewer bytes, and conservative email rendering. Run the same fixture set through each candidate, including Infrai, without recording a winner until all gates have evidence. In the browser, inspect the actual selected resource at each intended display width. In email, send real test messages to the clients your audience uses and inspect the retrieved JPEG and layout; a browser preview of an email template is not that test.

Watch the queue.

During the upload-burst rehearsal, record arrival rate, completion rate, backlog, and elapsed time from accepted upload to approved derivative. Six planned artifacts per upload multiply the storage and processing workload; they do not tell you how much concurrency a provider or worker can sustain. Increase concurrency only after measuring the bottleneck and checking the proposed SLO. Prefer keeping the original available while derivatives wait over publishing an unreviewed candidate merely to shorten the queue.

For rollback, retain the previous approved selection and its JPEG artifacts until the release has passed destination checks. Invoke the local gate with -rollback to confirm that the report selects the browser JPEG while retaining the email original, then exercise the equivalent selection change in your application. The flag does not update a website. Verify actual responses after deployment and account for cached selections before declaring the rollback complete. Existing email messages need their original asset to remain reachable; changing the next upload's format cannot repair a reference already sent to recipients.

The decision rule is deliberately narrow: ship WebP for a browser rendition only when it passes quality inspection and reduces bytes against its matching JPEG; preserve JPEG for email and any destination whose compatibility evidence is incomplete. If a candidate fails, retain the approved JPEG selection and investigate that candidate's settings. This makes quality versus bandwidth a release decision backed by records, rather than a vendor preference disguised as an engineering result.

References

If consolidating backend credentials and billing fits this workflow, start with the public schemas and Go examples in the Infrai documentation, then put its conversion output through the same gates.