# Transforming images to another format

**URL:** https://discourse.roots.io/t/transforming-images-to-another-format/26968
**Category:** bud
**Created:** 2024-04-09T21:01:24Z
**Posts:** 4

## Post 1 by @djmtype — 2024-04-09T21:01:24Z

I’m using Sage with bud-imagemin installed. Is it not possible to use it in Blade templates? Is something more required to add to bud config? I have specified:

```
app.imagemin.sharp.setGenerator(`webp`, {
    options: {
      encodeOptions: {
        quality: 80,
      }
    },
  })
```

Otherwise, the image never transforms to `webp` after running build. There’s nothing in the manifest regarding the image asset, and `type` still remains as jpeg.

Example: `<img src="@asset('/images/avatar.jpg?as=webp')" />`

---

## Post 2 by @djmtype — 2024-04-09T21:24:28Z

Without setting options, it works. So do I need to use `encode` instead of `setGenerator` in order to pass in my options?

---

## Post 3 by @i1100a — 2025-02-14T18:06:08Z

Sorry to revive this old thread but did you ever figure out how to make it work? Thanks in advance

---

## Post 4 by @Emmanuel-Odero — 2025-02-15T11:23:14Z

Hello, I might not know the correct approach to this actually, but maybe help with brainstormin alittle, you mentioned using `@asset('/images/avatar.jpg?as=webp')`. However, `@asset()` doesn’t directly handle the transformation for WebP in this manner. You might need to handle this within the build process by ensuring the transformation is baked into the Webpack pipeline. WebP transformations via `bud-imagemin` happen at build time, but using query parameters like `?as=webp` is a Blade helper feature that likely isn’t natively tied to `bud-imagemin`. I propose you configure Bud’s asset handling to include `.webp` as an output format during the build.

@i1100a @djmtype let me know of this solves the issue.
