vercel / next.js

The React Framework
https://nextjs.org
MIT License
124.99k stars 26.7k forks source link

Blurry PNGs rendered by `next/og` #60813

Open jstcki opened 8 months ago

jstcki commented 8 months ago

Link to the code that reproduces this issue

https://github.com/vercel/turbo/blob/734c764c61da9d6493f0d6616d10ec58702eafd1/docs/pages/api/og.tsx#L92-L93

To Reproduce

Look at any image rendered by next/og or @vercel/og, for example one from the Turbo docs.

Current vs. Expected behavior

Current

When you look at the image at 100% scale, you'll see that everything is rendered at 1/2 the resolution, fonts and graphics are blurry and pixelated.

image

Expected

When I set 1200x630 as image size, I expect that a crisp PNG is rendered instead the image being effectively rendered at 600x315px and scaled up.

Verify canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:59:33 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8112
Binaries:
  Node: 18.18.2
  npm: 7.24.2
  Yarn: 1.22.19
  pnpm: 8.8.0
Relevant Packages:
  next: 14.0.5-canary.65
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:

Which area(s) are affected? (Select all that apply)

Middleware / Edge (API routes, runtime)

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)

Additional context

No response

GMkonan commented 1 month ago

Any updates here?

Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!