Repository navigation
Really high-quality image resize pipeline #12
Answered
by
FelixFangX
vadimkantorov
asked this question in
Questions
Answered by
FelixFangX
Oct 16, 2026
Replies: 2 comments
|
It's resolution, not compression. On a retina screen (DPR 2), an image displayed at 640 CSS px covers 1280 device pixels. The Have Astro generate a 2x variant as well (astro 3.3+): <Image src={cover} width={640} densities={[1, 2]} alt="" />That outputs a |
0 replies
Answer selected by
delucis
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


It's resolution, not compression. On a retina screen (DPR 2), an image displayed at 640 CSS px covers 1280 device pixels. The
<Image width="640">output is only 640 px wide, so the browser upscales it. The Markdown one is the full-res original, so Safari downscales it, and that always looks sharper. That's also whyquality="max"doesn't change anything.Have Astro generate a 2x variant as well (astro 3.3+):
That outputs a
srcsetwith 640 and 1280 px files. If the display width varies, usewidths+sizesinstead. Both are in the<Image />reference. Densities larger than the source get skipped, so the original needs to be at least…