← Back to blog

Set It Once: Introducing Transformation Defaults

Every transformation in xform is driven by the request URL. Want a 400px WebP at quality 80? You ask for it: ?w=400&f=webp&q=80. That flexibility is the whole point, but it also means the same parameters end up repeated across your templates, your components, and every integration that touches your images. If you ever want to change them, you change them everywhere.

Transformation defaults fix that. You can now set per-source defaults for format, quality, fit, allowed widths, and flattening, configured once on the Settings tab of any source. When a request leaves a parameter out, the source fills it in. Your URLs get shorter, your output gets more consistent, and you get a single place to manage it all.

What you can default

Each default is toggled on or off independently, so you only enforce what you need:

  • Format - the output format (webp, avif, jpeg, and so on) when a request doesn't specify one. Set it to auto to negotiate the best modern format each browser supports.
  • Quality - the compression quality (1-100) applied when a request omits it.
  • Fit - how images are resized to fit their target dimensions (cover, contain, fill, inside, outside).
  • Allowed widths - a list of widths that requested sizes snap to. More on this below.
  • Flatten - composite transparent areas onto a background colour and strip the alpha channel, useful for forcing PNGs onto a solid background.

Turn on the format and quality defaults, and a bare request like https://your-source.xform.media/photo.jpg quietly becomes a quality-80 WebP. Nothing changes in your markup.

Width snapping keeps your variants under control

The allowed-widths setting is the one we're most excited about. Responsive images are great for performance, but they have a hidden cost: every distinct width you request is a separate image to transform and cache. A layout that asks for w=698 on one device and w=702 on another is generating two near-identical files for no real benefit.

With an allowed-widths list, requested widths snap to the nearest value you've defined. Given a list of 320, 640, 768, 960, 1200, a request for w=700 is served at 768. A request larger than your biggest width caps to it, and if a height is requested alongside the width, it scales proportionally so the aspect ratio is preserved. The result is a small, predictable set of cached variants instead of a long tail of one-off sizes.

We provide a sensible standard list out of the box, and you can add your own values for layouts that need specific breakpoints.

Soft defaults or hard rules

By default, these settings only fill in what a request leaves out, so an explicit parameter in the URL always wins. A request for ?q=95 overrides a default quality of 80. That keeps defaults convenient without taking away control.

Sometimes you want the opposite. If you need to guarantee that a source only ever serves WebP at a fixed quality, turn on Lock values. With locking enabled, the format, quality, and fit defaults are enforced even when a request tries to override them. It turns your defaults into hard rules for that source.

Width snapping always applies when it's enabled, in both modes: requested widths are constrained to your allowed list regardless of the lock setting.

Configure it in the dashboard

Everything lives on the Settings tab of your source. Flip a toggle to enable a default, choose its value from a dropdown, pick your allowed widths from the multi-select (or type in custom ones), and use the colour picker to set your flatten background. Save, and the new defaults take effect immediately. Changing a default automatically clears that source's cached images, so you never serve stale output while a setting catches up.

Try it today

Transformation defaults are available now for all xform sources. Open a source in your dashboard, head to the Settings tab, and set your defaults in a couple of minutes. Your URLs get simpler and your image output gets more consistent, with no code changes required.

As always, we'd love to hear how you're using them. If you have feedback or feature requests, reach out any time.


New to xform? Check out our plans and get started today.