diff --git a/.changeset/quiet-games-film.md b/.changeset/quiet-games-film.md new file mode 100644 index 0000000000000..bb9584d3693e1 --- /dev/null +++ b/.changeset/quiet-games-film.md @@ -0,0 +1,5 @@ +--- +"astro": minor +--- + +The `` component will now use `jpg` and `jpeg` respectively as fallback formats when the original image is in those formats. diff --git a/packages/astro/components/Picture.astro b/packages/astro/components/Picture.astro index d4327840a5540..b0791f163528b 100644 --- a/packages/astro/components/Picture.astro +++ b/packages/astro/components/Picture.astro @@ -17,8 +17,9 @@ const defaultFallbackFormat = 'png' as const; // Certain formats don't want PNG fallbacks: // - GIF will typically want to stay as a gif, either for animation or for the lower amount of colors // - SVGs can't be converted to raster formats in most cases +// - JPEGs compress photographs and high-noise images better than PNG in most cases // For those, we'll use the original format as the fallback instead. -const specialFormatsFallback = ['gif', 'svg'] as const; +const specialFormatsFallback = ['gif', 'svg', 'jpg', 'jpeg'] as const; const { formats = defaultFormats, pictureAttributes = {}, fallbackFormat, ...props } = Astro.props;