#Reading props
3 messages · Page 1 of 1 (latest)
Hey Umit 👋 You can use the getImage() utility to generate an optimized image outside of the <Image /> component. Once you have optimized the image you can access the src image, something like this: ```jsx
import { getImage } from "astro:assets";
import imagefrom "src/assets/images/image.jpg"
const optimized = await getImage({src: image, format: 'webp'})
// Get 'src' of image
console.log(optimized.src)
https://docs.astro.build/en/guides/images/#generating-images-with-getimage
This looks nifty, Bryceguy, have never had to intercept it like this before since I use the <Image/> straight away... with this solution, even the vanilla old html img tag should be fine after the fact, huh?