🎤 Builder Talk: The Story Behind Lady Gaga’s Digital Experience – Register now

Converting SVG to raster format using Sanity asset pipeline

7 replies
Last updated: Apr 23, 2020
I know its a bit of a random scenario, but if I wanted to convert an SVG to a raster format (webp, jpg, png, whatever) would the Sanity asset pipeline let me do this? Use-case is where theres a complicated-as-heck vector illustration where the raster would be a smaller filesize.
Apr 23, 2020, 5:01 AM
Apr 23, 2020, 5:03 AM
Ah,
&fm=png
. Cheers. I was writing
format
lol
Apr 23, 2020, 5:04 AM
Thanks Knut!
Apr 23, 2020, 5:04 AM
Apr 23, 2020, 5:04 AM
Apr 23, 2020, 5:03 AM
You can set background colors as well
Apr 23, 2020, 5:05 AM
Yeah turns out I was changing URLs while reading the docs for the JS helper lib, absolutely my bad đź‘Ť
Apr 23, 2020, 5:05 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?

Related answers

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
Error: unable to resolve image URL from source (undefined)Sep 11, 2022
Hey! We're fetching responsive images from <http://cdn.sanity.io|cdn.sanity.io> using `@sanity/image-url` to generate query...Jan 21, 2021
Discussion about implementing a cname asset domain in Sanity.ioApr 15, 2020
How do I render the image in Sanity blockcontent into a custom image component?Nov 28, 2020
Hey guys, does sanity have some kind of caching mechanism on request? im using the `@sanity/client` in a rn app; the issue...Jan 3, 2021
Cache issues with Sanity and Next.js resolved using server-side renderingJan 7, 2021
High bandwidth usage on Gatsby site with Sanity CDN imagesMar 25, 2021
Discussion about error connecting to Sanity API and potential solutionsJun 3, 2020
Discussion on GROQ behavior and implementation choices in Sanity.io APIMar 31, 2022
Discussion on using next-optimized-images with Sanity's CDN and potential issues with next/image and lazy loading.Feb 23, 2021

Related contributions

Turbo Start Sanity
- Template

The battle-tested Sanity template that powers Roboto Studio's websites

Go to Turbo Start Sanity

Schema UI - Next.js Sanity Starter
- Template

A Next.js starter template with Next.js 15, Tailwind CSS, shadcn/ui, and Sanity CMS with Live Editing. Get production-ready React components with matching Sanity schemas and queries. Build dynamic pages faster while keeping full control over customization.

Serge Ovcharenko
Go to Schema UI - Next.js Sanity Starter

The Swaddle
- Made with Sanity

A new brand identity to represent a more mature company, to signify The Swaddle’s evolution from publisher to production house, combined with an easier to navigate platform that can surface multiple content types - drawing readers through The Swaddle’s content offering.

Nightjar
Go to The Swaddle